Hi people. I am adding a new function into my general purpose DLL. The function continuously scans a group of pages from the sheet feeder. I want to hook the ESC key to stop scanning before the sheet feeder is empty. I need help with the 3rd and 4th parameters of SetWindowsHookEx. I guess that the 3rd parameter should be the module handle of my DLL and the 4th parameter should be the hInstance of the application program that calls the DLL. Is it true ? Thanks from Alvise.
Posted on 2001-06-30 08:24:00 by alvise
the 4th parameter is the Thread that you want to associate the hook with. GetWindowThreadProcessId will return the id of the thread that created the window. if you leave the 4th parameter NULL, then the hook becomes a system wide hook, and is associated with all threads.
Posted on 2001-06-30 17:19:00 by Sloat
Thanks for your reply. The problem is a bit more complicated than regular scenarios. Infact I am trying to establish a hook from within my DLL, and not from the application program that calls my DLL. And the thread that must be hooked is the main thread of the application program, i.e. the application itself. Regards from Alvise.
Posted on 2001-07-01 10:07:00 by alvise