KBDLLHOOKSTRUCT Structure
KBDLLHOOKSTRUCT Structure

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.
ValuePurpose
LLKHF_EXTENDEDTest the extended-key flag.
LLKHF_INJECTEDTest the event-injected flag.
LLKHF_ALTDOWNTest the context code.
LLKHF_UPTest the transition-state flag.
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
Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0.
6
Reserved.
7
Specifies 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.

Structure Information

HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systems Windows NT 4.0 SP3

See Also

Community Content

Visual Basic 9 declaration
Added by:Đonny
<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

Declaracion C#
Added by:David_González
[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; 
};



© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View