User32LoadKeyboardLayout Method

Loads a new input locale identifier (formerly called the keyboard layout) into the system.

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("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr LoadKeyboardLayout(
	string klid,
	KeyboardLayoutFlags flags
)

Parameters

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

Return Value

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.

Remarks

See Also