User32LoadKeyboardLayout Method
Loads a new input locale identifier (formerly called the keyboard layout) into the system.
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("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr LoadKeyboardLayout(
string klid,
KeyboardLayoutFlags flags
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function LoadKeyboardLayout (
klid As String,
flags As KeyboardLayoutFlags
) As IntPtr
Dim klid As String
Dim flags As KeyboardLayoutFlags
Dim returnValue As IntPtr
returnValue = User32.LoadKeyboardLayout(klid,
flags)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static IntPtr LoadKeyboardLayout(
String^ klid,
KeyboardLayoutFlags flags
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member LoadKeyboardLayout :
klid : string *
flags : KeyboardLayoutFlags -> IntPtr
No code example is currently available or this language may not be supported.
- klid String
-
The name of the input locale identifier to load.
This name is a string composed of the hexadecimal value of the Language Identifier (low word)
and a device identifier (high word).
For example, U.S. English has a language identifier of 0x0409, so the primary U.S. English layout is named "00000409".
Variants of U.S. English layout (such as the Dvorak layout) are named "00010409", "00020409", and so on.
- flags KeyboardLayoutFlags
-
Specifies how the input locale identifier is to be loaded
IntPtr
If the function succeeds, the return value is the input locale identifier corresponding to the
name specified in
klid.
If no matching locale is available, the return value is the default language of the system.