如何取得三个键盘提示灯当前状态
用API 函数 GetKeyboardState,例如:
unsigned char kbuf[256];
GetKeyboardState(kbuf);
if(kbuf[VK_CAPITAL]&1)
GetDlgItem(ID_CAPS_LOCK_KEY)->SetWindowText("On");
else
GetDlgItem(ID_CAPS_LOCK_KEY)->SetWindowText("Off");
if(kbuf[VK_NUMLOCK]&1)
GetDlgItem(ID_NUM_LOCK_KEY)->SetWindowText("On");
else
GetDlgItem(ID_NUM_LOCK_KEY)->SetWindowText("Off");
本文地址:http://com.8s8s.com/it/it759.htm