How can I press keyboard keys when the computer is locked

I would like to be able to "press" the Scroll Lock key (from the application), so that the scroll lock leading to the keyboard is turned on or off.

I used DllImport for the keybd_event function (from user32.dll) to do this, and my application works as a service when winning xp.

It works fine, but when I lock the computer (win + L), the function stops working.

I tried to start the service as a local service and as Admin, but it did not matter.

any suggestions?

thank.

+3
source share
3 answers

Thanks for helping the guys.

, msgina.dll dll (ginastub.dll), ( winlogon). "" .

, , , :)

0

, .

0

, Windows, , LogOn → .

Global interceptors do not easily handle managed code. You still need some unmanaged code to call it, but it can help you: http://www.codeproject.com/KB/system/globalsystemhook.aspx

I can’t say for sure whether this will work when you lock the computer, because it has extra precautions to prevent theft of passwords from keyloggers.

For educational purposes, if you want to intercept the login, gina.dll replacement will be the documented way.

0
source

Source: https://habr.com/ru/post/1785053/


All Articles