nVirtKey Specifies the virtual-key code of the nonsystem key. lKeyData Specifies the repeat count, context code, previous key-state flag, and transition-state flag, as shown in the following table. 0–15 Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key. 16-23 Specifies the scan code. This value depends on the original equipment manufacturer. 29 Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0. 30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up. 31 Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
直接查WM_KEYDOWN,WM_KEYUP这两个消息就可以。后面有详细的消息参数的说明。我记得他们是可以组合使用的。现在手边没有工具,不能具体的回答你。
Specifies the virtual-key code of the nonsystem key.
lKeyData
Specifies the repeat count, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0–15 Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key.
16-23 Specifies the scan code. This value depends on the original equipment manufacturer.
29 Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31 Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.