I have found similar questions on this page, but I can\'t seem to figure out how to interpret the answers or figure out if they are truly duplicates.
Here are the pos
In .Net 4.0 for this code to work I had to replace the call:
SetWindowsHookEx(WH_KEYBOARD_LL, _Hook, moduleHandle, 0);
with:
SetWindowsHookEx(WH_KEYBOARD_LL, _Hook, IntPtr.Zero, 0);
this fixed the problem ,This works when the call is made from the same module.
I got this from here