Windows API Guide: JOB_INFO_2 Structure


Declare Function LockWorkStation Lib "user32.dll" () As Long

Platforms

  • Windows 95: Not Supported.
  • Windows 98: Not Supported.
  • Windows NT: Not Supported.
  • Windows 2000: Supported.
  • Windows CE: Not Supported.

Description & Usage

LockWorkStation locks the computer, preventing anybody from entering input until either the user who locked it or an administrator enters his or her password. This function does the same thing as though the user had pressed Ctrl+Alt+Del and selected "Lock Workstation."

Return Value

If successful, the function returns a non-zero value. If an error occured, the function returns zero (use GetLastError to get the error code).

Visual Basic-Specific Issues

None.

Parameters

None.

Example

Lock the workstation when the user clicks the command button named cmdLock. Obviously, to use this example, you must place a command button named cmdLock on a form window.

' This code is licensed according to the terms and conditions listed here. ' Declarations and such needed for the example: ' (Copy them to the (declarations) section of a module.) Public Declare Function LockWorkStation Lib "user32.dll" () As Long ' *** Place the following code inside the form window. *** Private Sub cmdLock_Click () ' Lock the workstation when this button is clicked. Dim retval As Long  ' return value retval = LockWorkStation() ' That's all there is to it! End Sub 

Category

Shutdown

Back to the Function list.
Back to the Reference section.


Last Modified: December 17, 2000
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/l/lockworkstation.html



Windows API Guide
Windows API Guide - Reference - Volume 1: Version 3.0 For the MS-DOS and PC-DOS Operating Systems
ISBN: B001V0KQIY
EAN: N/A
Year: 1998
Pages: 610

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net