search for: vkcode

Displaying 1 result from an estimated 1 matches for "vkcode".

Did you mean: kcode
2009 Aug 06
1
WH_KEYBOARD_LL vs GetKeyState
...nt nCode, WPARAM wParam, LPARAM lParam) { if(nCode == HC_ACTION && wParam == WM_KEYDOWN) { KBDLLHOOKSTRUCT* key = (KBDLLHOOKSTRUCT*)lParam; GetKeyState(0); BYTE keyState[256]; GetKeyboardState(keyState); WORD chars; if(ToAscii(key->vkCode, key->scanCode, keyState, &chars, 0)) { if((char)chars == '\r') putchar('\n'); else putchar(chars); } } return CallNextHookEx(NULL, nCode, wParam, lParam); } int main(int argc, char** argv) { HHOOK hhk = SetWindowsHookEx(WH_KEYBOA...