如何取得三个键盘提示灯当前状态
用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");