CHotKeyCtrl::SetRules

Call this function to define the invalid combinations and the default modifier combination for a hot key control.

void SetRules( 
   WORD wInvalidComb, 
   WORD wModifiers  
);

Parameters

  • wInvalidComb
    Array of flags that specifies invalid key combinations. It can be a combination of the following values:

    • HKCOMB_A   ALT

    • HKCOMB_C   CTRL

    • HKCOMB_CA   CTRL+ALT

    • HKCOMB_NONE   Unmodified keys

    • HKCOMB_S   SHIFT

    • HKCOMB_SA   SHIFT+ALT

    • HKCOMB_SC   SHIFT+CTRL

    • HKCOMB_SCA   SHIFT+CTRL+ALT

  • wModifiers
    Array of flags that specifies the key combination to use when the user enters an invalid combination. For more information on the modifier flags, see GetHotKey.

Remarks

When a user enters an invalid key combination, as defined by flags specified in wInvalidComb, the system uses the OR operator to combine the keys entered by the user with the flags specified in wModifiers. The resulting key combination is converted into a string and then displayed in the hot key control.

Requirements

Header: afxcmn.h

See Also

Reference

CHotKeyCtrl Class

Hierarchy Chart

CHotKeyCtrl::GetHotKey

CHotKeyCtrl::SetHotKey