Retrieves the system default locale name.
Note
The application should call this function in preference to GetSystemDefaultLCID if designed to run only on Windows Vista and later.
int GetSystemDefaultLocaleName(
_Out_writes_(cchLocaleName)LPWSTR lpLocaleName,
int cchLocaleName
)
lpLocaleName
Type: Out_writes(cchLocaleName)LPWSTR
Pointer to a buffer in which this function retrieves the locale name.
cchLocaleName
Type: int
Size, in characters, of the output buffer indicated by lpLocaleName. The maximum possible character length of a locale name (including a terminating null character) is the value of LOCALE_NAME_MAX_LENGTH. This is the recommended size.
Type: int
Returns a value greater than 0 that indicates the length of the locale name, including the terminating null character, if successful.
This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:
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.
Header: Declared in winnls.h.
Library: Use kernelx.lib.