Partager via


CHotKeyCtrl::SetHotKey

Sets the keyboard shortcut for a hot key control.

void SetHotKey(
   WORD wVirtualKeyCode,
   WORD wModifiers
);

Parameters

  • [in] wVirtualKeyCode
    Virtual key code of the keyboard shortcut. For a list of standard virtual key codes, see Winuser.h.

  • [in] wModifiers
    A bitwise combination (OR) of flags that indicate the modifier keys in the keyboard shortcut.

    The modifier flags are as follows:

    Flag

    Corresponding Key

    HOTKEYF_ALT

    ALT key

    HOTKEYF_CONTROL

    CTRL key

    HOTKEYF_EXT

    Extended key

    HOTKEYF_SHIFT

    SHIFT key

Remarks

The virtual key code and the modifier keys together define the keyboard shortcut.

Requirements

Header: afxcmn.h

See Also

Reference

CHotKeyCtrl Class

Hierarchy Chart

CHotKeyCtrl::GetHotKey