Question UnhookWindowsHookEx Question

raysefo

Well-known member
Joined
Jul 21, 2010
Messages
207
Programming Experience
Beginner
Hi,

I want to get key presses on my application. The problem is when I use API.UnhookWindowsHookEx and after sometime to restart hooking as follows, application does NOT gets the key presses anymore.

How can I fix this?

Best Regards.

Dim _this As Process = Process.GetCurrentProcess
Dim modu As ProcessModule = _this.MainModule
hd = HookFunc
kh = _kh
hhk = API.SetWindowsHookEx(13, hd, API.GetModuleHandle(modu.ModuleName), 0)
 
Last edited by a moderator:
Back
Top