4

i built a program that hooks the keyboard and when some hotkey pressed it openning the door (that connected to the COM1 serial port of the computer).

this works fine, until i locking the computer (winkey+L). i want to be able to open the door with the same hotkey from the logon screen.

i using Windows XP & C#.

how do i do that?

thanks.

DxCK
  • 4,402
  • 7
  • 50
  • 89

4 Answers4

3

You need to write a Windows service that does this. Services and drivers can run outside of user logins, and services are a lot easier to write than drivers.

Anthony Mills
  • 8,676
  • 4
  • 32
  • 51
  • Hi, I have the exact same problem that I have tried to solve installing my program as a service with NSSM but it won't execute any code after starting, possibly a permissions issue even if I configured the log on settings to a local machine administrator account. Any thoughts? My topic's here: http://stackoverflow.com/questions/21797347/hook-keyboard-shortcuts-from-windows-lock-screen - Thanks – Mister Mystère Feb 15 '14 at 16:30
3

Yahhhhhhhhhhhh!! i found it!!

This can be done with "psexec /x" from sysinternals.

DxCK
  • 4,402
  • 7
  • 50
  • 89
  • Hi, I'm having the exact same problem using the WIN32 API in C++ (except I'm not controlling a door but writing in a file to update a webpage from an arduino in Keyboard emulation). How did you proceed to get those keyboard strokes through the lock screen? – Mister Mystère Feb 14 '14 at 19:18
2

you can't. When the screen is locked then mouse and keboard inputs aren't sent to running programs. It's a security thing. If you could communicate with running programs when the screen was locked then what would be the point of locking the screen

Glen
  • 21,816
  • 3
  • 61
  • 76
  • 2
    note that winkey+U are working from the logon screen, its running some microsoft accessability applications. i guess that this is not exclusive hard-codrd functionality, and other 3rd party accessability applications can also do something like that... – DxCK Oct 17 '09 at 22:57
  • 1
    @DxCK, the OS can do pretty much whatever it wants to, that's why winkey+U works. programs running in user space have to obey the rules laid down by the OS. One of those rules is that key presses aren't passed to programs running in user space. I've never seen any accessability programs used from the locked screen before (I'm not saying they don't exist, just I've never come across them) – Glen Oct 20 '09 at 19:22
1

Programs that are running with normal user rights are not allowed to mess with the logon screen for security reasons. This makes it harder for key loggers to see your password.

You need to convert your program into a service. Please see http://msdn.microsoft.com/en-us/library/ms686953(VS.85).aspx for details on how to implement and install a service.

Hendrik Brummermann
  • 8,242
  • 3
  • 31
  • 55