--- UID: NF:winuser.ActivateKeyboardLayout title: ActivateKeyboardLayout function (winuser.h) description: Sets the input locale identifier (formerly called the keyboard layout handle) for the calling thread or the current process. The input locale identifier specifies a locale as well as the physical layout of the keyboard. helpviewer_keywords: ["ActivateKeyboardLayout","ActivateKeyboardLayout function [Keyboard and Mouse Input]","HKL_NEXT","HKL_PREV","KLF_REORDER","KLF_RESET","KLF_SETFORPROCESS","KLF_SHIFTLOCK","KLF_UNLOADPREVIOUS","_win32_ActivateKeyboardLayout","_win32_activatekeyboardlayout_cpp","inputdev.activatekeyboardlayout","winui._win32_activatekeyboardlayout","winuser/ActivateKeyboardLayout"] old-location: inputdev\activatekeyboardlayout.htm tech.root: inputdev ms.assetid: VS|winui|~\winui\windowsuserinterface\userinput\keyboardinput\keyboardinputreference\keyboardinputfunctions\activatekeyboardlayout.htm ms.date: 12/05/2018 ms.keywords: ActivateKeyboardLayout, ActivateKeyboardLayout function [Keyboard and Mouse Input], HKL_NEXT, HKL_PREV, KLF_REORDER, KLF_RESET, KLF_SETFORPROCESS, KLF_SHIFTLOCK, KLF_UNLOADPREVIOUS, _win32_ActivateKeyboardLayout, _win32_activatekeyboardlayout_cpp, inputdev.activatekeyboardlayout, winui._win32_activatekeyboardlayout, winuser/ActivateKeyboardLayout req.header: winuser.h req.include-header: Windows.h req.target-type: Windows req.target-min-winverclnt: Windows 2000 Professional [desktop apps only] req.target-min-winversvr: Windows 2000 Server [desktop apps only] req.kmdf-ver: req.umdf-ver: req.ddi-compliance: req.unicode-ansi: req.idl: req.max-support: req.namespace: req.assembly: req.type-library: req.lib: User32.lib req.dll: User32.dll req.irql: targetos: Windows req.typenames: req.redist: ms.custom: 19H1 f1_keywords: - ActivateKeyboardLayout - winuser/ActivateKeyboardLayout dev_langs: - c++ topic_type: - APIRef - kbSyntax api_type: - DllExport api_location: - User32.dll - Ext-MS-Win-NTUser-Keyboard-l1-1-0.dll - Ext-MS-Win-NTUser-Keyboard-l1-1-1.dll - ext-ms-win-ntuser-keyboard-l1-1-2.dll - Ext-MS-Win-NTUser-Keyboard-L1-2-0.dll - Ext-MS-Win-NTUser-Keyboard-L1-2-1.dll - Ext-MS-Win-NTUser-Keyboard-L1-3-0.dll api_name: - ActivateKeyboardLayout --- # ActivateKeyboardLayout function ## -description Sets the input locale identifier (formerly called the keyboard layout handle) for the calling thread or the current process. The input locale identifier specifies a locale as well as the physical layout of the keyboard. ## -parameters ### -param hkl [in] Type: HKL Input locale identifier to be activated. The input locale identifier must have been loaded by a previous call to the LoadKeyboardLayout function. This parameter must be either the handle to a keyboard layout or one of the following values.
Value | Meaning |
---|---|
|
If this bit is set, the system's circular list of loaded locale identifiers is reordered by moving the locale identifier to the head of the list. If this bit is not set, the list is rotated without a change of order. For example, if a user had an English locale identifier active, as well as having French, German, and Spanish locale identifiers loaded (in that order), then activating the German locale identifier with the KLF_REORDER bit set would produce the following order: German, English, French, Spanish. Activating the German locale identifier without the KLF_REORDER bit set would produce the following order: German, Spanish, English, French. If less than three locale identifiers are loaded, the value of this flag is irrelevant. |
|
If set but KLF_SHIFTLOCK is not set, the Caps Lock state is turned off by pressing the Caps Lock key again. If set and KLF_SHIFTLOCK is also set, the Caps Lock state is turned off by pressing either SHIFT key. These two methods are mutually exclusive, and the setting persists as part of the User's profile in the registry. |
|
Activates the specified locale identifier for the entire process and sends the WM_INPUTLANGCHANGE message to the current thread's focus or active window. |
|
This is used with KLF_RESET. See KLF_RESET for an explanation. |
|
This flag is unsupported. Use the UnloadKeyboardLayout function instead. |