The KBDLLHOOKSTRUCT structure contains information about a low-level keyboard input event.
Syntax
typedef struct { DWORD vkCode; DWORD scanCode; DWORD flags; DWORD time; ULONG_PTR dwExtraInfo; } KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;
Members
vkCode Specifies a virtual-key code. The code must be a value in the range 1 to 254. scanCode Specifies a hardware scan code for the key. flags Specifies the extended-key flag, event-injected flag, context code, and transition-state flag. This member is specified as follows. An application can use the following values to test the keystroke flags. ValuePurposeLLKHF_EXTENDEDTest the extended-key flag. LLKHF_INJECTEDTest the event-injected flag. LLKHF_ALTDOWNTest the context code. LLKHF_UPTest the transition-state flag. 0Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad. The value is 1 if the key is an extended key; otherwise, it is 0.1-3Reserved.4Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0.5Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0.6Reserved.7Specifies the transition state. The value is 0 if the key is pressed and 1 if it is being released.time Specifies the time stamp for this message, equivalent to what GetMessageTime would return for this message.dwExtraInfo Specifies extra information associated with the message.
0
1-3
4
5
6
7
Structure Information
HeaderDeclared in Winuser.h, include Windows.hMinimum operating systems Windows NT 4.0 SP3
See Also
Hooks Overview, LowLevelKeyboardProc, SetWindowsHookEx
<StructLayout(LayoutKind.Sequential)> _Public Structure KBDLLHOOKSTRUCT Public vkCode As Integer Public scanCode As Integer Public flags As KBDLLHOOKSTRUCTFlags Public time As Integer Public dwExtraInfo As IntPtrEnd Structure<Flags()> _Public Enum KBDLLHOOKSTRUCTFlags As Integer LLKHF_EXTENDED = &H1 LLKHF_INJECTED = &H10 LLKHF_ALTDOWN = &H20 LLKHF_UP = &H80End Enum
<Flags()> _Public Enum KBDLLHOOKSTRUCTFlags As Integer LLKHF_EXTENDED = &H1 LLKHF_INJECTED = &H10 LLKHF_ALTDOWN = &H20 LLKHF_UP = &H80End Enum
[StructLayout(LayoutKind.Sequential)]
publicstructKBDLLHOOKSTRUCT
{
///<summary>
/// Especifica el codigo de tecla virtual, el codigo esta entre 1 y 254.
///</summary>
publicint vkCode;
/// Especifica el escaneo de hardware del codigo de la tecla
publicint scanCode;
/// especifica flags extendidos, mirar la estrucutra 'KBDLLHOOKSTRUCT' para mas info
publicint flags;
/// especifica el time stamp para este mensaje.
publicint time;
/// Especifica informacion extra para el mensaje
publicint dwExtraInfo;
};