I'm begining with hooks, and I think the way they work is a mystery.
If someone had an example, I'll gladly accept it or any help.
I've created a DLL containing the following hook callback function :
__declspec( dllexport )
LRESULT CALLBACK myHookProc (int nCode, WPARAM wParam, LPARAM lParam);
In this function, I'm logging events into a file, but no events are received.
I've tried both adding a WH_KEYBOARD hook and a WH_KEYBOARD_LL hook
but no one receives Keyboard Input.
In the Win32 API, the last argument of SetWindowsHookEx must be zero
in order to attach this hook to every running thread, and here is the
way I call it :
hook = SetWindowsHookEx(WH_KEYBOARD_LL, (HOOKPROC)hookproc, dllinst, 0);
Thanks
|