3 out of 3 rated this helpful - Rate this topic

GetThreadLocale function

Applies to: desktop apps only

Returns the locale identifier of the current locale for the calling thread.

Note  This function can retrieve data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data.

Syntax

LCID GetThreadLocale(void);

Parameters

This function has no parameters.

Return value

Returns the locale identifier of the locale associated with the current thread.

Windows Vista: This function can return the identifier of a custom locale. If the current thread locale is a custom locale, the function returns LOCALE_CUSTOM_DEFAULT. If the current thread locale is a supplemental custom locale, the function can return LOCALE_CUSTOM_UNSPECIFIED. All supplemental locales share this locale identifier.

Remarks

When an application process launches, it uses the Standards and Formats variable for the locale. For more information, see NLS Terminology.

When a new thread is created in a process, it inherits the locale of the creating thread. This locale can be either the default Standards and Formats locale or a different locale set for the creating thread in a call to SetThreadLocale. GetThreadLocale and SetThreadLocale can be used to modify the locale of the new thread.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winnls.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

National Language Support
National Language Support Functions
GetSystemDefaultLCID
GetUserDefaultLCID
SetThreadLocale

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
About the sub-thread locale
In the article, it says "When a new thread is created in a process, it inherits the locale of the creating thread." But my test in both C++ app. and .Net app. shows the sub-thread's local is different from the creating thread if I call SetThreadLocale() to set another locale (for example, set to system default locale) before creating the thread.