Arduino to lock Windows 7 when I walk away

I am working on a project that I hope will "lock" my Windows 7 laptop when I get up and walk away. I am stumbling over how to interface the Arduino with Windows and how to get Windows to lock-up automatically when I leave the PC. I am planning on using RFID with the Arduino to sense when I leave.

I understand that it is impossible to simulate a ctrl+alt+del command via serial because that combination of keys creates an interrupt that goes directly to the CPU.

Any input is greatly appreciated!

Thanks!v

Is a locked screen saver a reasonable substitute for you?

You could try interfacing your Arduino to the PC as a keyboard. Shouldn't be too hard (I'm sure I've seen duino key repeaters etc. done before), then it could send the scan codes for Ctrl+Alt+Del.

You could write a simple program in VB.

When it recives a certain text from the serial port e.g "lock" then it will run the following "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"

@CodingBadly - Yes, a locked screen saver would work just fine. Is that method much different as suggested by Tornado?

No not very different.

Tornados solution is "a real lock", but i guess the password protected screen saver is almost as secure at least against the casual "non hacker" type of person.

As for coding, since under all circumstances you would have tto write a program that runs on the PC and monitors the serial port for some data coming from Arduino indicating that you left, it's really a matter of taste which of the two solutions you choose, both will require a few linws of code, i.e. starting a program /process, either the screensaver or the user32 dll with suitable parameters when Arduino send a "the king has left the building" message :-)

Tornados solution is "a real lock", but i guess the password protected screen saver is almost as secure at least against the casual "non hacker" type of person.

I believe, for NT based operating systems (NT, 2000, XP, Vista, 7, and the Server variants), there is no difference. If I remember correctly, the screen saver is run in the same workstation as the login process.

Yes, a locked screen saver would work just fine. Is that method much different as suggested by Tornado?

No. It is entirely up to you which you prefer. This can be used to start the default screen saver...

  PostMessage( GetForegroundWindow, WM_SYSCOMMAND, SC_SCREENSAVE, 0 );

Please let us know how your project goes.