Here is another useful function. Global Const $DESKTOP_SWITCHDESKTOP = 0x0100 Func _IsWorkstationLocked() Local $Result = False $hDesktop = DllCall('user32.dll', 'hwnd', 'OpenDesktop', 'str', 'Default', 'int', 0, 'int', 0, 'int', $DESKTOP_SWITCHDESKTOP) If Not @error Then $Result = DllCall('user32.dll', 'int', 'SwitchDesktop', 'hwnd', $hDesktop[0]) $Result = Not $Result[0] DllCall('user32.dll', 'int', 'CloseDesktop', 'hwnd', $hDesktop[0]) EndIf Return $Result EndFunc ;==>_