Page 1 of 1

LOCK EVERYTHING IN WINDOWS

PostPosted: September 15th, 2005, 8:16 am
by Mohammad Ahmadzadeh
Hi everybody,
As you know, if you press WIN+L keys in WindowsXP, Windows stucks and nothing will work until you log in to Windows (Ctrl+Alt+Del, Win+R, Alt+Tab, Ctrl+Esc, …. will NOT work, but programs are still working in memory).
I want to simulate this by programming. Suppose I have a button on the form by pressing it, Windows locks and for unlocking it user must enter his/her own password.
Programmatically I can simulate pressing WIN+L keys, but I have a list of people in my database with their own password and I want to manage them manually, so I can not use WIN+L and have to simulate it.
Can anyone help me?

PostPosted: September 16th, 2005, 9:15 am
by Kambiz
Hi,

You can call LockWorkStation Windows API.

Cheers

PostPosted: September 17th, 2005, 10:33 am
by Mohammad Ahmadzadeh
Hi Kambiz

There is a misunderstanding!

I didn't know "LockWorkStation" API and thank you for it, but I want to simulate it, which means locking everything and just my program work.

By the way I found dWinLock component from "http://www.dwinlock.kassl.de", but it can not disable Alt+Shift+TAB and also is trial.

Do you know any other way?

PostPosted: September 22nd, 2005, 2:54 pm
by Radagast
Why don't you use OnKeyPress to disable any reaction on hitting Alt? I know it's stupid but it's as simple as you can imagine. Just add line that makes system believe Alt (and/or Ctrl) is not pressed.
Or you can always ask system to give focus back to your application after losing it. Result should be the same as disabling Alt+(Shift+)Tab.

PostPosted: September 23rd, 2005, 3:41 pm
by Mohammad Ahmadzadeh
Thanx Radagast, I'll work on it! :wink: