i've made a test with SetWindowsHookEx to capture keyboard messages to MY OWN APPLICATION. it works, except the fact that the hook doesn't hook anything else when i use the keyboard in another application. when i switch back to my own application, the hook doesn't hook my keyboard inputs anymore.
why ? how to solve the problem ?
here is how i create the hook :
hookdata = SetWindowsHookEx( WH_KEYBOARD, KeyboardProc, hInstance, 0 );
and here is my callback function :
LRESULT CALLBACK KeyboardProc ( int code, WPARAM w, LPARAM l )
MessageBox( g_hWnd, "KEYBOARD", "HOOKED", MB_OK );