AutoIt: Comment obtenir le temps d'inactivité du système, ou si économiseur d'écran est actif?

StackOverflow https://stackoverflow.com/questions/3867584

  •  28-09-2019
  •  | 
  •  

Question

J'aimerais avoir un script AutoIt journal le temps d'inactivité. Sinon, je voudrais être en mesure de détecter lorsque l'économiseur d'écran est actif. Il n'y a pas de fonction qui me donne une ou l'autre de ces éléments. Comment puis-je obtenir cette fonctionnalité?

Était-ce utile?

La solution

Eh. Je l'ai trouvé sur un 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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top