Applies to: desktop apps only
Contains information about a low-level keyboard input event.
Syntax
typedef struct tagKBDLLHOOKSTRUCT {
DWORD vkCode;
DWORD scanCode;
DWORD flags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT, *LPKBDLLHOOKSTRUCT;
Members
- vkCode
-
Type: DWORD
-
A virtual-key code. The code must be a value in the range 1 to 254.
- scanCode
-
Type: DWORD
-
A hardware scan code for the key.
- flags
-
Type: DWORD
-
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.
The following table describes the layout of this value.
Bits Description 0 Specifies 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-3 Reserved. 4 Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0. 5 The context code. The value is 1 if the ALT key is pressed; otherwise, it is 0. 6 Reserved. 7 The transition state. The value is 0 if the key is pressed and 1 if it is being released. - time
-
Type: DWORD
-
The time stamp for this message, equivalent to what GetMessageTime would return for this message.
- dwExtraInfo
-
Type: ULONG_PTR
-
Additional information associated with the message.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
See also
- Reference
- LowLevelKeyboardProc
- SetWindowsHookEx
- Conceptual
- Hooks
Send comments about this topic to Microsoft
Build date: 2/3/2012
[StructLayout(LayoutKind.Sequential)]
publicstructKBDLLHOOKSTRUCT
{
///<summary>
/// Especifica el codigo de tecla virtual, el codigo esta entre 1 y 254.
///</summary>
publicint vkCode;
///<summary>
/// Especifica el escaneo de hardware del codigo de la tecla
///</summary>
publicint scanCode;
///<summary>
/// especifica flags extendidos, mirar la estrucutra 'KBDLLHOOKSTRUCT' para mas info
///</summary>
publicint flags;
///<summary>
/// especifica el time stamp para este mensaje.
///</summary>
publicint time;
///<summary>
/// Especifica informacion extra para el mensaje
///</summary>
publicint dwExtraInfo;
};
<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 IntPtr
End Structure<Flags()> _
Public Enum KBDLLHOOKSTRUCTFlags As Integer
LLKHF_EXTENDED = &H1
LLKHF_INJECTED = &H10
LLKHF_ALTDOWN = &H20
LLKHF_UP = &H80
End Enum