In fact, this is alsoProgramLoad the analysis instance of the resource.
Create a Win32 project.
The source code is as follows:
// testloadstr. cpp: defines the entry point of the application. // # Include "stdafx. H "# include" testloadstr. H "# include" resource. H "# define max_loadstring 100 // global variable: hinstance hinst; // the current instance tchar sztitle [max_loadstring]; // Title Bar text tchar szwindowclass [max_loadstring]; // main window class name // The Forward Declaration of the function contained in the Code module: atommyregisterclass (hinstance ); boolinitinstance (hinstance, INT); lresult callback (hwnd, uint, wparam, lparam); int_ptr callbackabout (hwnd, uint, wparam, lparam); int apientry _ twinmain (hinstance, hinstance hprevinstance, lptstr lpcmdline, int ncmdshow) {const int bufsize = 256; tchar wapptitle [bufsize]; // initialize the global string int KK = loadstring (hinstance, ids_app_title , wapptitle, bufsize); int klk = getlasterror (); // obtain the desktop handle hwnd = getdesktopwindow (); // display wapptitle in the message window MessageBox (hwnd, wapptitle, _ T ("Test Loading string resource information"), mb_ OK);}
WhereIds_app_titleThe resource ID is set in the following figure:
Shows the test result:
How to attach images and sounds is added below:
..........