Platform SDK: International Features

SetThreadLocale

The SetThreadLocale function sets the calling thread's current locale.

BOOL SetThreadLocale (
  LCID Locale   // locale identifier
);

Parameters

Locale
[in] Specifies the new locale for the calling thread. This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values.
Value Meaning
LOCALE_SYSTEM_DEFAULT Default system locale.
LOCALE_USER_DEFAULT Default user locale.

For more information, see Locales.

Return Values

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

When a thread is created, it uses the system default thread locale. The system reads the system default thread locale from the registry when the system boots. This system default can be modified for future process and thread creation using Control Panel's International application.

The SetThreadLocale function affects the selection of resources that are defined with a LANGUAGE statement. This affects such functions as CreateDialog, DialogBox, LoadMenu, LoadString, and FindResource, and sets the code page implied by CP_THREAD_ACP, but does not affect FindResourceEx.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Winnls.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

National Language Support Overview, National Language Support Functions, CreateDialog, DialogBox, LoadMenu, LoadString, FindResource, GetThreadLocale, GetSystemDefaultLCID, GetUserDefaultLCID, MAKELCID