Questions tagged [unhookwindowshookex]
The unhookwindowshookex tag has no usage guidance.
7
questions
-3
votes
1answer
547 views
Unhooking a hook set with SetWindowsHookEx more than once crashes the hooked process
I am trying to hook the keyboard and mouse events of a target application.
I followed the SO question How to hook external process with SetWindowsHookEx and WH_KEYBOARD, and the hooks are installed ...
-4
votes
1answer
41 views
Java JNA: How cast integer (int) to HHOOK?
I want unhook all hook messages (ring 3) and not is able because in Java seems that not is possible the cast from int for HHOOK type.
Someone know how solve this?
import com.sun.jna.platform.win32....
0
votes
1answer
197 views
UnhookWindowsHookEx produces ERROR_INVALID_HOOK_HANDLE?
I'm trying to implement a background application in WPF that does some things only when right-clicking the top of the screen, so I tried hooking WH_MOUSE_LL, which works great. The problem is ...
0
votes
1answer
193 views
How to UnHook properly?
I made a very simple Hook codes (I'm a beginner).
I opened Notepad and tested.
If I press ANY key it make a beep and printed itself.
Except "x" key, it is a terminator key.
Question :
I do not ...
4
votes
2answers
3k views
Unloading an Injected DLL
I have a DLL I inject into other processes using SetWindowsHookEx. Inside the DLL I increment the module's reference counter by calling GetModuleHandleEx so I can control when the module is unloaded.
...
12
votes
2answers
3k views
How can I ensure that UnhookWindowsHookEx is called even upon abnormal termination?
Unfortunately, MSDN is not clear enough with it. I'm writing a program which uses a global hook, and I'm worrying about what would happen if the program terminates abnormally (crashes, killed by user, ...
4
votes
2answers
4k views
Unloading DLL from all processes after unhooking global CBT hook
How do you properly unload a DLL from all processes when the system-wide hook that loaded them gets unloaded?
From MSDN:
You can release a global hook
procedure by using
UnhookWindowsHookEx, ...