kristian / system-hook

Global Keyboard / Mouse Hook for Java applications.
MIT License
269 stars 48 forks source link

GlobalKeyboardHook does not work on windows when TaskManager is in focus #28

Closed LogicBig closed 5 years ago

LogicBig commented 5 years ago

I tried GlobalKeyboardExample it works fine but does not work when a system dialog e.g. TaskManager or Registry Editor (regex) is in focus. Looks like those dialogs consume all events. Is that possible to create a keyboard hook to listen at lower level?

kristian commented 5 years ago

To the best of my knowlege this is a security mechanism introduced by Windows, in order for you to not do any malicious activities on those system critical apps. SystemHook already utilizes two very low level APIs (SetWindowsHookEx and if the raw flag is set it creates an invisible message-only window). But as the name suggests, these are both APIs which are provided to you by the operating system. So if the operating system is preventing you from reading certain inputs, there is no way arround that.

amiru3f commented 4 years ago

Hi Dude, hope this is not too late to post! Just run your keylogger (or app that enabled hook) as Administrator, hook chain on elevated apps UI will just be passed to elevated key loggers.