Kernel32GetSystemDefaultLocaleName Method

Retrieves the system default locale name.

Note: it is recommended that applications call GetUserDefaultLocaleName(StringBuilder, Int32) in preference over this function. This is due to the user locale generally being more useful and accurate for the user than the system locale.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, 
	SetLastError = true)]
public static bool GetSystemDefaultLocaleName(
	StringBuilder localeName,
	int length
)

Parameters

localeName  StringBuilder
Pointer to a buffer in which this function retrieves the locale name.
length  Int32
Size, in characters, of the output buffer indicated by localeName parameter.

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.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also