UnloadKeyboardLayout Function

The UnloadKeyboardLayout function unloads an input locale identifier (formerly called a keyboard layout).

Syntax

BOOL UnloadKeyboardLayout(      
    HKL hkl );

Parameters

hkl
[in] Input locale identifier to unload.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. The function can fail for the following reasons:

  • An invalid input locale identifier was passed.
  • The input locale identifier was preloaded.
  • The input locale identifier is in use.

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.

Windows 95/98/Me: UnloadKeyboardLayout cannot unload the system default input locale identifier. This ensures that an appropriate character set is always available for the user to type commands for the shell or names for the file system.

Windows NT/2000/XP: UnloadKeyboardLayout cannot unload the system default input locale identifier if it is the only keyboard layout loaded. You must first load another input locale identifier before unloading the default input locale identifier.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.

See Also

Tags :


Page view tracker