Good Morning, I copied a script from here and was able to get it so that when the screen is unlocked it displays a message, however what I would like to have happen is only the display a message once, but keep the script running at all times, and then every time the workstation is unlocked display a message. Here is what I have so far. Global Const $DESKTOP_SWITCHDESKTOP = 0x100
While 1
If _CheckLocked() = 0 Then
msgbox(0, "", "Test")
EndIf
WEnd
Func _CheckLocked()
$hLockedDLL = DllOpen("user32.dll")
$hDesktop = DllCall($hLockedDLL, "int", "OpenDesktop", "str", "Default", "int", 0, "int", 0, "int", $DESKTOP_SWITCHDESKTOP)
$ret = DllCall($hLockedDLL, "int", "SwitchDesktop", "int", $hDesktop[0])
DllCall($hLockedDLL, "int", "CloseDesktop", "int", $hDesktop[0])
If $ret[0] = 0 Then
$iLocked = 1
ElseIf $ret[0] = 1 Then
$iLocked = 0
EndIf
DllClose($hLockedDLL)
If $iLocked Then
Return 1
Else
Return 0
EndIf
EndFunc Thanks, Grimm