GetAsyncKeyState Function--------------------------------------------------------------------------------The GetAsyncKeyState function determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState. SyntaxSHORT GetAsyncKeyState( int vKey
);
ParametersvKey
[in] Specifies one of 256 possible virtual-key codes. For more information, see Virtual-Key Codes.
Windows NT/2000/XP: You can use left- and right-distinguishing constants to specify certain keys. See the Res section for further information.Return ValueIf the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Res.
);
ParametersvKey
[in] Specifies one of 256 possible virtual-key codes. For more information, see Virtual-Key Codes.
Windows NT/2000/XP: You can use left- and right-distinguishing constants to specify certain keys. See the Res section for further information.Return ValueIf the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Res.
解决方案 »
- 怎样获取注册表的终极操作权限,最后一点分全散了.
- _RecordsetPtr vRecordset 使用Addnew后,取消添加状态时调用CancelUpdate出错!
- vcnet如何导入真彩色位图啊?(怎么导入后什么都没有插入啊)明天结帐
- 我想调用线程时传递一个窗口对象怎么操作????
- 在使用DOM方法生成XML文件时,如何为xml文件添加DOCTYPE?
- 请问如何改变view中输出字符的背景色?
- 实模式和保护模式到底有什么区别
- http://www.csdn.net/expert/topic/732/732693.xml?temp=.4267542
- 求sqlite3.exe文件
- 请问CreateProcessAsUser 为什么 产生的子进程可能会导致父进程崩溃?
- 请问如何知道鼠标具体点在frame中的那一个网页
- 怎么让程序随系统启动?
就是这样的 1xxx,xxxx,xxxx,xxxx
对于short型的数据来说,最高位置1,代表它是负的,所以你可以用返回值是否小于零来判断键是否被按下。