Hi, im trying to disable user input using global system hooks. heres some of my code. my understanding is mouse input should be disabled as it is not passed down after PlaybackMouseHook is called. However when i run this code, i can still move the mouse. It looks as if the hook works for a bit and then is silently unhooked as described below but im not sure. i tried running as admin no luck. msdn says:
The hook procedure should process a message in less time than the data entry specified in the LowLevelHooksTimeout value in the following registry key:
The value is in milliseconds. If the hook procedure times out, the system passes the message to the next hook. However, on Windows 7 and later, the hook is silently removed without being called. There is no way for the application to know whether the hook is removed.
however this key isnt present on my win 8 system. I have added a key with a 200 millisecond value and i dont think this has any effect. can anyone help?
static LRESULT CALLBACK PlaybackMouseHook(UINT nCode,WPARAM wParam,LPARAM lParam)
_declspec(dllexport) BOOL setPlaybackHook(HWND hWnd)
if(hWndServer != NULL)
wh_llkey_playback_hook = SetWindowsHookEx(WH_KEYBOARD_LL,(HOOKPROC)PlaybackHook,hInst,0);
wh_llmouse_playback_hook = SetWindowsHookEx(WH_MOUSE_LL,(HOOKPROC)PlaybackMouseHook,hInst,0);
if(wh_llkey_playback_hook != NULL && wh_llmouse_playback_hook != NULL)
hWndServer = hWnd;
BOOL ret = setPlaybackHook(m_hWnd);
ret = clearPlaybackHook(m_hWnd);