WM_HOTKEY message

Posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.

#define WM_HOTKEY                       0x0312

Parameters

wParam

The identifier of the hot key that generated the message. If the message was generated by a system-defined hot key, this parameter will be one of the following values.

Value Meaning
IDHOT_SNAPDESKTOP
-2
The "snap desktop" hot key was pressed.
IDHOT_SNAPWINDOW
-1
The "snap window" hot key was pressed.

lParam

The low-order word specifies the keys that were to be pressed in combination with the key specified by the high-order word to generate the WM_HOTKEY message. This word can be one or more of the following values. The high-order word specifies the virtual key code of the hot key.

Value Meaning
MOD_ALT
0x0001
Either ALT key was held down.
MOD_CONTROL
0x0002
Either CTRL key was held down.
MOD_SHIFT
0x0004
Either SHIFT key was held down.
MOD_WIN
0x0008
Either WINDOWS key was held down. These keys are labeled with the Windows logo. Hotkeys that involve the Windows key are reserved for use by the operating system.

Remarks

WM_HOTKEY is unrelated to the WM_GETHOTKEY and WM_SETHOTKEY hot keys. The WM_HOTKEY message is sent for generic hot keys while the WM_SETHOTKEY and WM_GETHOTKEY messages relate to window activation hot keys.

Requirements

Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

RegisterHotKey

WM_GETHOTKEY

WM_SETHOTKEY

Conceptual

Keyboard Input