The concept of "locking a workstation" does not exist in any Windows version
prior to NT. So for 9x you're toast. For NT-based systems, call the
LockWorkstation API.
Note, for the record, that this function is callable only by processes
running on the interactive desktop. In addition, a user must be logged on,
and the workstation cannot already be locked.
Private Declare Sub LockWorkStation Lib "user32.dll" ()
'calling syntax:
LockWorkStation

Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
: Can you make a link in an application to lock the workstation the user
: is using, with windows XP specifically, and maybe also windows 95.
: Thank you.
James - 29 Nov 2004 13:50 GMT
Is it possible to put this as a click function into a list box?
Randy Birch - 29 Nov 2004 23:22 GMT
Sure, why not?

Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
: Is it possible to put this as a click function into a list box?
What do you mean by only callable in an interactive desktop?
Randy Birch - 29 Nov 2004 23:22 GMT
A service can't call lockworkstation - only an application that is running
on a desktop under a logged-on user can call it.

Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
: What do you mean by only callable in an interactive desktop?