Help Contents / GUI programming / Window P-S / WindowRegisterHotKey

WindowRegisterHotKeybool WindowRegisterHotKey window hotkeyId modifiers virtualKeyCode 

Registers a system wide hotkey.  Every time the user presses the hotkey registered here,  this window will receive a hotkey event.  It will receive the event even if the application is in the background  and does not have the input focus  because the user is working with some other application. 

Parameters 

hotkeyId: Numeric identifier of the hotkey.  For applications this must be between 0 and 0xBFFF.  If this function is called from a shared DLL,  it must be a system wide unique identifier between 0xC000 and 0xFFFF.  This is a MSW specific detail. 

modifiers: A bitwise combination of  wxMOD_SHIFT, wxMOD_CONTROL, wxMOD_ALT or wxMOD_WIN  specifying the modifier keys that have to be pressed along with the key. 

virtualKeyCode: The virtual key code of the hotkey. 

Return value: true if the hotkey was registered successfully.  false if some other application already registered a hotkey  with this modifier/virtualKeyCode combination. 

Remarks: Use EVT_HOTKEY(hotkeyId, fnc) in the event table  to capture the event.  This function is currently only implemented under Windows.  It is used in the Windows CE port for detecting hardware button presses. 


previous: WindowRefresh	next: WindowReleaseMouse
