Display different strings in multiple languages-loadstring Function

Source: Internet
Author: User

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:

..........


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.