Microsoft KB Archive/258047

{|
 * width="100%"|

INFO: Which Locale Determines How My Application Is Presented?

 * }

Q258047

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 2000
 * the operating system: Microsoft Windows NT

-

SUMMARY
Microsoft Windows 2000 has multiple locales, all of which play a role in determining how your application will run and how it is presented to the user.

The System Default Locale
The system default locale acts as an ANSI simulation layer. It determines the ANSI code page that the system uses when running a non-Unicode application. For example, if the system default locale is Japanese, then to a non-Unicode application, the operating system will behave similar to a Japanese operating system, fully able to support non-Unicode Japanese applications, but unable to support non-Japanese compatible applications (such as a Korean non-Unicode application). The operating system uses the Japanese code page 932 when ANSI-Unicode translation is needed. So, the system default locale determines whether or not your non-Unicode application will run.

The system default locale is set at installation. It can be changed in Control Panel. To get the current system default locale, call the GetSystemDefaultLCID function.

The User Locale and the Thread Locale
The user locale and the thread locale determine which settings are used for formatting dates, times, currency, and large numbers as a default for each user. The user locale and the thread locale also determine the sort order for sorting text. The thread locale can be set separately for each thread, and when the thread locale and the user locale are different, the thread locale overrides the user locale.

For example, even though your application is English, and the system default locale is English, as long as the user locale is Spanish (and you did not set the thread locale specifically), your strings will be sorted by the Spanish sorting order. If you need your application's numbers, currency, or sorting to be done in a certain locale, make sure that you set the thread locale explicitly by calling the SetThreadLocale function.

When each thread starts, the thread locale is defaulted to the user locale. The user locale is defaulted to the locale that matches the language of the localized system. To get the user locale, call the GetUserDefaultLCID function. Call the GetThreadLocale function to get the calling thread locale.

User UI Language
The user UI language determines the default language of menus and dialog boxes, messages, INF files, and help files. For example, your English application that is running under an operating system with Japanese UI language will bring up Japanese common dialog boxes, Japanese message boxes, and Japanese system error messages.

For an application that stores multiple copies of its resources, and at run time lets the operating system decide which language version of the resource to load, the user UI language determines the language version of the resources loaded. For example, if your application contains a menu resource, for example, menu "GENERIC" in English, Japanese, German, and uses the LoadMenu function to load the menu at run time, and if the user UI language is Japanese, the Japanese menu is loaded. System locale and user locale has no effect on this.

For non-MUI systems, the user UI language is set at installation and cannot be changed. For MUI systems, the user UI language can be changed in Control Panel through Regional Options. Call the GetUserDefaultUILanguage function to get the current user UI language.

Additional query words:

Keywords : kbOSWinNT kbOSWin2000 kbDSupport

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch