User32LockWorkStation Method

Locks the workstation's display.

Locking a workstation protects it from unauthorized use.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll")]
public static bool LockWorkStation()

Return Value

Boolean
If the function succeeds, the return value is .

Because the function executes asynchronously, a return value indicates that the operation has been initiated;

It does not indicate whether the workstation has been successfully locked.

If the function fails, the return value is .

Remarks

See Also