How do I check if Windows desktop is locked
Q: In AutoIt, how do I check if Windows desktop is locked
What I have
Let's take this example AutoIt script. It pings an URL in an indefinite
loop and reports the response time in a tray tip.
While 1
$responsetime = Ping("www.google.com")
TrayTip("", $responsetime, 1)
sleep(5000)
Wend
Desired result
The new script should only ping if the desktop is not locked. But I
haven't found a reliable way to check for this
While 1
$isLocked = secretFunctionIdontKnow
If $isLocked Then
Local $responsetime = Ping("www.google.com")
TrayTip("", $responsetime, 1)
EndIf
sleep(5000)
Wend
Hint: The function WinExist("A") seems not reliable enough because a
desktop without any open windows will report back 0 (=false) even when
unlocked
No comments:
Post a Comment