Raysefo

Raysefo

  • 1.4k
  • 284
  • 148.7k

API.UnhookWindowsHookEx Problem?

Jan 5 2012 2:18 AM
Hi,

I am getting key strokes from keyboard. First I start listening keystrokes as follows:

Process _this = Process.GetCurrentProcess();             ProcessModule mod = _this.MainModule;             hd = HookFunc;             kh = _kh;               hhk = API.SetWindowsHookEx(13, hd, API.GetModuleHandle(mod.ModuleName), 0);

Then according to some condition I stop listening keystrokes as follows:
return API.UnhookWindowsHookEx(hhk); 

The problem is, when I want to listen to keystrokes again, It does NOT capture them.

Any help please?

Best Regards.




Answers (7)