VB and VBA Users Source Code: Locking a Workstation/Computer
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Locking a Workstation/Computer
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, January 15, 2003
Hits:
27484
Category:
Visual Basic General
Article:
The following code shows two similiar methods that will lock your workstation (for Win 2k or XP). Private Declare Function LockWorkStation Lib "user32.dll" () As Long 'Purpose : Locks a workstation/machine (recommended method) 'Inputs : N/A 'Outputs : N/A 'Author : Andrew Baker 'Date : 13/11/2002 10:14 'Notes : Requires W2K or newer 'Revisions : Sub WorkstationLock() 'Call API directly Call LockWorkStation End Sub 'Purpose : Locks a workstation/machine 'Inputs : N/A 'Outputs : N/A 'Author : Andrew Baker 'Date : 13/11/2002 10:14 'Notes : Requires W2K or newer 'Revisions : Sub WorkstationLock2() 'Use run32 to call API Shell "rundll32.exe user32.dll, LockWorkStation", vbHide End Sub
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder