Détermine si le système applique les ajustements de temps périodiques
#include <Date.au3>
_Date_Time_GetSystemTimeAdjustment ( )
#include <Date.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
; Sous Vista le \" SetSystemTimeAdjustment \" Windows API peut être rejetée en raison de la sécurité du système
Example()
Func Example()
Local $aInfo
; Ouvrez l'horloge afin que nous puissions regarder le plaisir
Run("RunDll32.exe shell32.dll,Control_RunDLL timedate.cpl")
WinWaitActive("[CLASS:#32770]")
; Obtenez des ajustements de temps actuels
$aInfo = _Date_Time_GetSystemTimeAdjustment()
; Ralentir l'horloge
If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1] / 10, False) Then
MsgBox($MB_SYSTEMMODAL, "Error", "System clock cannot be DOWN" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage())
Exit
EndIf
MsgBox($MB_SYSTEMMODAL, "Information", "Slowing down system clock", 2)
Sleep(5000)
; Accélérer l'horloge
If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1] * 10, False) Then
MsgBox($MB_SYSTEMMODAL, "Error", "System clock cannot be UP" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage())
EndIf
MsgBox($MB_SYSTEMMODAL, "Information", "Speeding up system clock", 2)
Sleep(5000)
; Réglage du temps de réinitialisation
If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1], True) Then
MsgBox($MB_SYSTEMMODAL, "Error", "System clock cannot be RESET" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage())
Else
MsgBox($MB_SYSTEMMODAL, "Information", "System clock restored")
EndIf
EndFunc ;==> Example