search for: hc_action

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

2009 Aug 06
1
WH_KEYBOARD_LL vs GetKeyState
...ill > * ensure that if the app is looping on GetKeyState(), it'll get the > * right key state. > */ Code: #include <windows.h> #include <cstdio> LRESULT CALLBACK LowLevelKeyboardProc(int 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)) { i...