GetUserDefaultLCID function (winnls.h)

Returns the locale identifier for the user default locale.

Caution  If the user default locale is a custom locale, an application cannot accurately tag data with the value or exchange it. In this case, the application should use GetUserDefaultLocaleName in preference to GetUserDefaultLCID.
 
Note  Applications that are intended to run only on Windows Vista and later should use GetUserDefaultLocaleName.
 

Syntax

LCID GetUserDefaultLCID();

Return value

Returns the locale identifier for the user default locale, represented as LOCALE_USER_DEFAULT. If the user default locale is a custom locale, this function always returns LOCALE_CUSTOM_DEFAULT, regardless of the custom locale that is selected. For example, whether the user locale is Hawaiian (US), haw-US, or Fijiian (Fiji), fj-FJ, the function returns the same value.

Remarks

This function can retrieve data from custom locales. Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winnls.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

ConvertDefaultLocale

GetLocaleInfo

GetSystemDefaultLCID

GetUserDefaultLocaleName

National Language Support Functions