GetKeyboardLayoutList Function

The GetKeyboardLayoutList function retrieves the input locale identifiers (formerly called keyboard layout handles) corresponding to the current set of input locales in the system. The function copies the identifiers to the specified buffer.

Syntax

UINT GetKeyboardLayoutList(      
    int nBuff,     HKL *lpList );

Parameters

nBuff
[in] Specifies the maximum number of handles that the buffer can hold.
lpList
[out] Pointer to the buffer that receives the array of input locale identifiers.

Return Value

If the function succeeds, the return value is the number of input locale identifiers copied to the buffer or, if nBuff is zero, the return value is the size, in array elements, of the buffer needed to receive all current input locale identifiers.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The input locale identifier is a broader concept than a keyboard layout, since it can also encompass a speech-to-text converter, an Input Method Editor (IME), or any other form of input.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 4.0

See Also



Community Content

dmex
vb.net syntax
<DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function GetKeyboardLayoutList(ByVal size As Integer, <Out, MarshalAs(UnmanagedType.LPArray)> ByVal hkls As IntPtr()) As Integer
End Function
Tags :

dmex
C# syntax
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true, ExactSpelling=true)]
public static extern int GetKeyboardLayoutList(int size, [Out, MarshalAs(UnmanagedType.LPArray)] IntPtr[] hkls);
Tags :

Page view tracker