原文地址 : http://www.zdexe.com/program/201004/603.html
結構7: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.
指定虛擬鍵值。該值必須在1到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.
指定擴展鍵標志,事件注入標志,上下文代碼,轉換狀態碼。成員如下所示。應用程序可以使用下列值來檢查鍵盤敲擊標志。
| Value值 |
Purpose目的 |
| LLKHF_EXTENDED |
Test the extended-key flag. 測試擴展鍵標志。 |
| LLKHF_INJECTED |
Test the event-injected flag. 測試事件注入標志。 |
| LLKHF_ALTDOWN |
Test the context code. 測試上下文代碼。 |
| LLKHF_UP |
Test 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,否則為0。
1-3 :Reserved.
保留。
4 :Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0.
指定事件是否被注入。被注入為1,否則為0。
5 :Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0.
指定上下文代碼。如果按下了ALT,該值為1,否則為0
6 :Reserved.
保留。
7 :Specifies the transition state. The value is 0 if the key is pressed and 1 if it is being released.
指定轉換狀態。如果該鍵被按下該值為1,如果被釋放為0。
time : Specifies the time stamp for this message, equivalent to what GetMessageTime would return for this message.
指定消息的時間戳,相當於GetMessageTime返回的值。
dwExtraInfo : Specifies extra information associated with the message.
指定和該消息相關聯的擴展信息。
