2010-10-05 107 views

回答

1

Eh。在論壇上找到它。

#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 
+0

_Timer_GetIdleTime()函數使用user32.dll中的GetLastInputInfo。在Timers.au3創建之前,這對我來說有點痛苦。我不知道這是現在圖書館的標準部分。謝謝你的回答很好。 – Copas 2010-10-07 22:25:32

相關問題