KeyboardProc polls multiple times

I've created a keyboard hook via SetWindowsHookEx() (not low level), and everything works fine, but every time I hit a key, the KeyboardProc is called multiple times.
Anyone know what I'm doing wrong? The documentation seems to be silent
Hi,

We need the callback and the installation code, as you have did something wrong.
 
hook=SetWindowsHookEx(WH_KEYBOARD, kbProc, hInstance, NULL);


1
2
3
4
5
6
7
8
LRESULT CALLBACK kbProc(int code, WPARAM wParam, LPARAM lParam){
    if(code<0) return CallNextHookEx(code, wParam, lParam);
	if(code==HC_ACTION){
		KeyPressed();
		return 1;
	}
	return CallNextHookEx(code, wParam, lParam);
}
Topic archived. No new replies allowed.