RegisterHotKey()

Purpose
The RegisterHotKey function defines a system-wide hot key.
 
Library Transcribed by Date of page Updated on
User32.dll J.Paris 17.03.03  
 
Restrictions on use
Requires Windows NT 3.1 or later; Requires Windows 95 or later
 
Declare 32-bit
declare function RegisterHotKey Lib "user32.dll"(

        byval hwnd as integer, 

        byval ind as integer, 

        byval fsModifiers as integer, 

        byval vk as integer

        ) 

As Integer

Required Type definition
 none
 
Parameters

hwnd

Identifies the window that will receive WM_HOTKEY messages generated by the hot key. If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop

ind Specifies the identifier of the hot key.

fsModifiers 

Specifies keys that must be pressed in combination with the key specified by the nVirtKey parameter in order to generate the WM_HOTKEY message. The fsModifiers parameter can be a combination of the following values:

MOD_ALT

1

Either ALT key must be held down.

MOD_CONTROL

2

Either CONTROL key must be held down.

MOD_SHIFT 

4

Either SHIFT key must be held down.

vk

Specifies the virtual-key code of the hot key. See the Virtual Key Codes for US English-language keyboard page

Available also, the VK.exe utility (Baris Engin) that displays the code (Dec and Hex) of any single depressed key.

 
Return value
If the function succeeds, non-zero. If it faiis, 0.
 
Example

see Enable/Disable_DEL_Key 

 
Comments
 
 
See also

 UnRegisterHotKey