SHORT GetKeyState(int nVirtKey /* virtual-key code,eg.VK_F1 */);
 
//If the high-order bit is 1, the key is down; otherwise, it is up.
//If the low-order bit is 1, the key is toggled.
 
//例如:
GetKeyState(VK_MENU) & 0x8000
//Alt按下
 
GetKeyState(VK_CONTROL) & 0x8000
//Ctrl按下

 


本文链接地址: 用GetKeyState判断指定按键是否按下
https://blog.qingfengju.com/index.asp?id=139

上一篇: 计算文本所占区域(字符串宽度,高度)
下一篇: 用文件映射(File Mapping)实现进程间内存共享

分类:Win32/C++ 查看次数:10581 发布时间:2009/8/12 23:59:59