LANGUAGE Statement in RC Differs in Windows NT from Windows 95Last reviewed: January 15, 1998Article ID: Q140763 |
1.30 4.00 | 3.51
WINDOWS | WINDOWS NTkbprg The information in this article applies to:
SUMMARYThe LANGUAGE statement in resource files sets the language for all resources up to the next LANGUAGE statement or to the end of the file. When the LANGUAGE statement appears before the BEGIN in an ACCELERATORS, DIALOG, MENU, RCDATA, or STRINGTABLE resource definition, the specified language applies only to that resource. The general syntax for the language statement is:
LANGUAGE language, sublanguage MORE INFORMATIONIn Windows NT, several language versions of the same resource (with the same ID and type) can be loaded at the same time. The programmer can decide which language version of the resource to use dynamicaly by calling SetThreadLocale(). For example, the following is in a RC file: ABOUTBOX DIALOG DISCARDABLE 52, 57, 144, 45 LANGUAGE LANG_GERMAN, SUBLANG_GERMAN STYLE DS_MODALFRAME | WS_CAPTION FONT 8, "System" BEGIN CTEXT "Microsoft(r)",-1,0,5,144,8 CTEXT "German menu Example",-1,0,14,144,8 ICON IDR_MENU,-1,10,10,18,20 DEFPUSHBUTTON "OK",IDOK,53,25,32,14,WS_GROUP ENDABOUTBOX DIALOG DISCARDABLE 52, 57, 144, 45 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US STYLE DS_MODALFRAME | WS_CAPTION FONT 8, "System" BEGIN CTEXT "Microsoft(r)",-1,0,5,144,8 CTEXT "Menu Example",-1,0,14,144,8 ICON IDR_MENU,-1,10,10,18,20 DEFPUSHBUTTON "OK",IDOK,53,25,32,14,WS_GROUP ENDIn Winodws NT, you can call SetThreadLocale (MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT)) to set the thread locale to German, and the German resource (the first dialog box) would is automatically used. In Windows 95, multiple copies of a resource with exactly the same ID and resource type cannot be loaded at the same time. Thus, the only value of LANGUAGE that works is the one that matches the current locale. In the previous example, if the current system locale is German, then only the German dialog box will be loaded.
|
Additional reference words: 4.00 1.30 setlocale kbinf
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |