I have been using global keyboard hooks successfully since I started using them. They have worked just fine under Windows XP, Vista, Windows 7. However, they don't work for some applications under Windows 10 for some reason.
I have found 2 Windows applications that block the hooks from working:
Windows Task Manager
(I only mention the Registry as an example. I do not recommend anyone using keyboard hooks with the Registry).
Also, and frustratingly, there are some 3rd party applications that seem to now be blocking Keyboard Hooks.
(My main concern is not about the Task Manager or the Registry, but, rather, other 3rd party applications. If I can get the hooks working with the Task Manager with Experts Exchange's (your) help, then I can probably get it working with other problem apps as well).
Please find attached a sample keyboard hook app (with source code). If you open Notepad (or just about any other application) then launch "SampleApplication.exe" then press random keys on the keyboard, you will notice that "SampleApplication.exe" intercepts ALL key presses and displays the key selected its UI.
When you build "SampleApplication.exe" it will reside in:
This was created with VS 2008. (I have not tried converting it to VS 2013 or VS 2015).
Open the solution, then rebuild "MouseKeyboardLibrary" then rebuild "HookSampleApplication", then run "SampleApplication.exe".
However, if you launch the Task Manager, (give Task Manager the focus), then press keys, "SampleApplication.exe" does NOT intercept any key presses.
Does anyone know why? Is there a work-around?
I've tried creating a registry key in:
and giving it various values, but it makes no difference.