[This is preliminary documentation and subject to change.]
The LockWorkStation function locks the workstation's display, protecting it from unauthorized use.
This function has no parameters.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.
This function has the same result as pressing Ctrl+Alt+Del and clicking Lock Workstation. To unlock the workstation, the user must log in.
Common reasons for failure include no user is logged on, the workstation is already locked, the process is not running on the interactive desktop, or the request is denied by the Graphical Identification and Authentication (GINA) DLL.
Windows NT: Requires version 5.0 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib