User32RegisterHotKey(IntPtr, Int32, UInt32, UInt32) Method
Defines a system-wide hotkey.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool RegisterHotKey(
IntPtr hWnd,
int id,
uint modifiers,
uint vKey
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function RegisterHotKey (
hWnd As IntPtr,
id As Integer,
modifiers As UInteger,
vKey As UInteger
) As Boolean
Dim hWnd As IntPtr
Dim id As Integer
Dim modifiers As UInteger
Dim vKey As UInteger
Dim returnValue As Boolean
returnValue = User32.RegisterHotKey(hWnd,
id, modifiers, vKey)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool RegisterHotKey(
IntPtr hWnd,
int id,
unsigned int modifiers,
unsigned int vKey
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member RegisterHotKey :
hWnd : IntPtr *
id : int *
modifiers : uint32 *
vKey : uint32 -> bool
No code example is currently available or this language may not be supported.
- hWnd IntPtr
-
A handle to the window that will receive WM_Hotkey messages
generated by the hot key.
If this parameter is Zero,
WM_Hotkey messages are posted to the message queue of the calling thread
and must be processed in the message loop.
- id Int32
-
The identifier of the hotkey.
If the hwnd parameter is 0, then the hotkey is associated with the current thread
rather than with a particular window.
If a hotkey already exists with the same hWnd and id parameters,
see Remarks for the action taken.
- modifiers UInt32
-
The keys that must be pressed in combination with the key specified by the vKey parameter
in order to generate the WM_Hotkey message.
- vKey UInt32
-
The virtual-key code of the hotkey.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.