문제

I'd like to have an AutoIt script log the idle time. Alternatively, I'd like to be able to detect when the screensaver is active. There is no function that gives me either of these. How would I go about getting this functionality?

도움이 되었습니까?

해결책

Eh. Found it on a forum.

#include <Timers.au3>

Global $iLimit = 5 ; idle limit in seconds

HotKeySet("{ESC}", "_Quit")

AdlibRegister("_CheckIdleTime", 500)

While 1
    Sleep(20)
WEnd

Func _CheckIdleTime()
    If _Timer_GetIdleTime() > $iLimit * 1000 Then MsgBox(16, "Timeout", "You haven't done anything in " & $iLimit & " seconds...  Get busy!", 3)
EndFunc   ;==>_CheckIdleTime

Func _Quit()
    Exit
EndFunc   ;==>_Quit
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top