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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Unicode, ExactSpelling := true,
SetLastError := true>]
Public Shared Function GetSystemDefaultLocaleName (
localeName As StringBuilder,
length As Integer
) As Boolean
Dim localeName As StringBuilder
Dim length As Integer
Dim returnValue As Boolean
returnValue = Kernel32.GetSystemDefaultLocaleName(localeName,
length)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Unicode, ExactSpelling = true,
SetLastError = true)]
static bool GetSystemDefaultLocaleName(
StringBuilder^ localeName,
int length
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true,
SetLastError = true)>]
static member GetSystemDefaultLocaleName :
localeName : StringBuilder *
length : int -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.