;==========INCLUDE=========== #include #include #include #include #include #include #include #include #include ;=======OPT================= Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 1) Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 0) ;=========================== #cs Nom : The End Version : 2.00 Description : C'est un petit programme assez simple qui permet d'effectuer une action (arrêt, redémarrage, fermeture de la session, mise en veille, mise en veille prolongée et exécution d'un fichier ou d'un programme) à une heure choisie (= programmateur) ou dans un temps choisi (= minuteur). Par exemples : - Eteindre l'ordinateur dans 2 heures et 30 minutes ; - Démarrer Google Chrome à 10h30. Langue : Français & Anglais Version AutoIT : v3.3.8.1 Testé sur : Windows 7 Intégrale x64 (Admin) Auteur : Ricardo R. (ricardog@live.be) Remerciement à : jguinch & mikell & Tlem & aux Forums AutoIT Mise à jour 2.00 : - Affichage de l'heure en 24h pour le français et format 12h pour l'anglais. - Options dans l'icône de la zone de notification - Décompte - Possibilité de mettre en pause, de reprendre et de réinitialiser - Personnaliser le nombre de secondes (ou minutes voire heures !) avant l'exécution de l'action choisie pour vous prévenir ue l'action choisie sera exécuter dans X secondes (X étant le nombre que vous avez choisi et qui est par défaut 60) - Désactiver la prévention - Ajuster les secondes (comme pour les heures et les minutes) - UpDown (Montée-Descente) peut être ajusté avec les flèches du clavier ou avec la molette de la souris - Paramètres sauvegardés dans le registre. Le programme ne néccesite donc aucune Include et aucun autre fichier. #ce #cs Name : The End Version : 2.00 Description : It's a little simple program allowing the perform of an action (shutdown, reboot, logoff, standby, hibernate or execution of a file or a program) at the time chosen (= programmer) or in a time chosen (= timer). For examples : - Shutdown the computer in 2 hours and 30 minutes ; - Boot Google Chrome at 10h30. Language : English & French AutoIT Version : v3.3.8.1 Tested on : Windows 7 Ultimate x64 (Admin) Author : Ricardo R. (ricardog@live.be) Thanks you to : jguinch & mikell & Tlem & the AutoIT's forums (Fr and En) Update 2.00 : - Display of the hour in 24h format for french version and 12h format for english version - Options in the tray icon - A countdown - Possibility to pause and resume the countdown (only for the timer) - Possibilité to reset the countdown (timer and programmer) - Personnalize the number of seconds of the prevention - You can disable the prevention - Adjust of the seconds (like hours and minutes) - UpDown cans adjust by the arrows or with the wheel of the mouse - Settings saved in the registry. The program doesn't need Include or another file. #ce $ReadSettingsLng = RegRead("HKEY_CURRENT_USER\Software\The End", "LNG") If $ReadSettingsLng = "FR" Then $GUIPrincipale = GUICreate("The End", 273, 242, -1, -1) ; Le programme démarre en Français GUISetOnEvent($GUI_EVENT_CLOSE, "Quitter") $Tab = GUICtrlCreateTab(0, 0, 275, 500, $TCS_HOTTRACK) $MinuteurTab = GUICtrlCreateTabItem("Minuteur") GUICtrlSetTip(-1, "Minuteur. Effectue une action après un certains temps") $MinuteurBoutonValider = GUICtrlCreateButton("Valider", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 253) GUICtrlSetOnEvent(-1, "MinuteurBoutonValider") GUICtrlSetTip(-1, "Démarrer le minuteur") $MinuteurBoutonAide = GUICtrlCreateButton(" Aide", 140, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 24) GUICtrlSetCursor(-1, 4) GUICtrlSetOnEvent(-1, "MinuteurBoutonAide") GUICtrlSetTip(-1, "Aide sur le minuteur") $MinuteurInputHeure = GUICtrlCreateInput("0", 10, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Nombre d'heure(s) du minuteur") $MinuteurUpDownHeure = GUICtrlCreateUpdown($MinuteurInputHeure, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 99, 0) $MinuteurInputMin = GUICtrlCreateInput("0", 95, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Nombre de minute(s) du minuteur") $MinuteurUpDownMin = GUICtrlCreateUpdown($MinuteurInputMin, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $MinuteurInputSec = GUICtrlCreateInput("0", 190, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Nombre de seconde(s) du minuteur") $MinuteurUpDownSec = GUICtrlCreateUpdown($MinuteurInputSec, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $MinuteurTxtHeure = GUICtrlCreateLabel("H", 75, 35, 26, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $MinuteurTxtMin = GUICtrlCreateLabel("M", 160, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $MinuteurTxtSec = GUICtrlCreateLabel("S", 255, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") Global $MinuteurCombo = GUICtrlCreateCombo("", 32, 90, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1, "Arrêter|Redémarrer|Fermer la session|Mettre en veille|Mettre en veille prolongée|Autre", "Arrêter") GUICtrlSetTip(-1, "Sélectionner une action à effectuer." & @CRLF & " Pour démarrer un programme sélectionner Autre et entrée le chemin du programme ci-dessous") GUICtrlSetOnEvent(-1, "MinuteurComboEventFR") $MinuteurTxtAutre = GUICtrlCreateLabel("Autre action :", 32, 120, 77, 19) GUICtrlSetFont(-1, 10, 400, 4, "Times New Roman") $MinuteurInputOtherAction = GUICtrlCreateInput("", 32, 135, 177, 21) GUICtrlSetTip(-1, "Chemin du fichier à exécuter") $MinuteurBoutonOther = GUICtrlCreateButton(". . .", 216, 135, 25, 21) GUICtrlSetTip(-1, "Explorateur Windows pour rechercher le chemin de votre programme") GUICtrlSetOnEvent(-1, "MinuteurBoutonOther") GUICtrlSetState($MinuteurTxtAutre, $GUI_HIDE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_HIDE) GUICtrlSetState($MinuteurBoutonOther, $GUI_HIDE) $MinuteurTxtCountdown = GUICtrlCreateLabel("Pas de minuteur en cours", 10, 162, 250, 40, $SS_Center) GUICtrlSetFont(-1, 9, 400, 1, "Times New Roman") GUICtrlSetTip(-1, "Décompte") ;========================================================== ;========================================================== ;========================================================== $ProgrammateurTab = GUICtrlCreateTabItem("Programmateur") GUICtrlSetTip(-1, "Programmateur. Effectue une action à une heure précise") $ProgInputHeure = GUICtrlCreateInput("0", 10, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Heure du programmteur") $ProgUpDownHeure = GUICtrlCreateUpdown($ProgInputHeure, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 23, 0) $ProgInputMin = GUICtrlCreateInput("0", 95, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Minute du programmateur") $ProgUpDownMin = GUICtrlCreateUpdown($ProgInputMin, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $ProgInputSec = GUICtrlCreateInput("0", 190, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Seconde du programmateur") $ProgUpDownSec = GUICtrlCreateUpdown($ProgInputSec, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $ProgTxtHeure = GUICtrlCreateLabel("H", 75, 35, 26, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgTxtMin = GUICtrlCreateLabel("M", 160, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgTxtSec = GUICtrlCreateLabel("S", 255, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgBoutonValider = GUICtrlCreateButton("Valider", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 253) GUICtrlSetOnEvent(-1, "ProgBoutonValider") GUICtrlSetTip(-1, "Démarrer le programmateur") $ProgBoutonAide = GUICtrlCreateButton(" Aide", 140, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 24) GUICtrlSetCursor(-1, 4) GUICtrlSetOnEvent(-1, "ProgBoutonAide") GUICtrlSetTip(-1, "Aide sur le programmateur") $ProgCombo = GUICtrlCreateCombo("", 32, 90, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1, "Arrêter|Redémarrer|Fermer la session|Mettre en veille|Mettre en veille prolongée|Autre", "Arrêter") GUICtrlSetTip(-1, "Sélectionner une action à effectuer." & @CRLF & " Pour démarrer un programme sélectionner Autre et entrée le chemin du programme ci-dessous") GUICtrlSetOnEvent(-1, "ProgComboEventFR") $ProgTxtAutre = GUICtrlCreateLabel("Autre action :", 32, 120, 77, 19) GUICtrlSetFont(-1, 10, 400, 4, "Times New Roman") GUICtrlSetState(-1, $GUI_HIDE) $ProgInputOtherAction = GUICtrlCreateInput("", 32, 135, 177, 21) GUICtrlSetTip(-1, "Chemin du fichier à exécuter") GUICtrlSetState(-1, $GUI_HIDE) $ProgBoutonOther = GUICtrlCreateButton(". . .", 216, 135, 25, 21) GUICtrlSetTip(-1, "Explorateur Windows pour rechercher le chemin de votre programme") GUICtrlSetOnEvent(-1, "ProgBoutonOther") GUICtrlSetState(-1, $GUI_HIDE) $ProgTxtCountdown = GUICtrlCreateLabel("Pas de programmateur en cours", 10, 162, 250, 36, $SS_Center) GUICtrlSetFont(-1, 9, 400, 1, "Times New Roman") GUICtrlSetTip(-1, "Décompte") ;=============================================== ;=============================================== $AproposTab = GUICtrlCreateTabItem("À propos ...") GUICtrlSetTip(-1, "À propos du programme") $AproposGroupThanks = GUICtrlCreateGroup("Remerciements", 8, 200, 257, 34) GUICtrlSetTip(-1, "Remerciements") $AproposGroupThanksJguinch = GUICtrlCreateLabel("Jguinch, Mikell, Tlem et aux forums AutoIT (Fr - En)", 16, 217, 240, 19) GUICtrlSetTip(-1, "Remerciements") $AproposGroupTestedOn = GUICtrlCreateGroup("Testé sur", 8, 145, 257, 50) GUICtrlSetTip(-1, "Testé sur") $AproposGroupTestedOnAutoit = GUICtrlCreateLabel("Version AutoIT : v3.3.8.1 ", 16, 161, 132, 19) GUICtrlSetTip(-1, "AutoIT") $AproposGroupTestedOnWindows = GUICtrlCreateLabel("Windows 7 Intégrale 64 Bits", 16, 176, 141, 19) GUICtrlSetTip(-1, "Windows") GUICtrlCreateGroup("", -99, -99, 1, 1) $AproposGroupCree = GUICtrlCreateGroup("Créé par", 8, 106, 257, 35) GUICtrlSetTip(-1, "Créé par") $AproposGroupCreePar = GUICtrlCreateLabel("Ricardo R. (ricardog@live.be)", 16, 122, 172, 20) GUICtrlSetTip(-1, "Créé par") GUICtrlCreateGroup("", -99, -99, 1, 1) $AproposGroupLangue = GUICtrlCreateGroup("Langue (redémarre le programme)", 8, 24, 257, 34) GUICtrlSetTip(-1, "Langue du programme") $FrancaisOpt = GUICtrlCreateRadio("Français", 60, 37, 81, 17) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetOnEvent(-1, "Aproposfr") GUICtrlSetTip(-1, "Le programme est en français") $AnglaisOpt = GUICtrlCreateRadio("English", 150, 37, 81, 17) GUICtrlSetOnEvent(-1, "Aproposen") GUICtrlSetTip(-1, "Mettre le programme en anglais." & @CRLF & "Le programme va redémarrer automatiquement") GUICtrlCreateGroup("", -99, -99, 1, 1) $AproposGroupPrevention = GUICtrlCreateGroup("Temps avant la prévention d'une action", 8, 65, 257, 38) GUICtrlSetTip(-1, "Temps avant qu'une info bulle vous prévienne qu'il reste un certain temps avant l'exécution de l'action choisie.") Global $ReadSettingsPrevent = RegRead("HKEY_CURRENT_USER\Software\The End", "PreventTime") If $ReadSettingsPrevent = "" Then $ReadSettingsPrevent = 59 EndIf Global $AproposGroupPreventionInput = GUICtrlCreateInput($ReadSettingsPrevent, 85, 78, 50, 18, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) GUICtrlSetTip(-1, "Temps avant qu'une info bulle vous prévienne qu'il reste un certain temps avant l'exécution de l'action choisie." & @CRLF & "Par défaut, 59 secondes avant que l'action soit effectuée.") $AproposGroupPreventionInputUpDown = GUICtrlCreateUpdown($AproposGroupPreventionInput, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit($AproposGroupPreventionInputUpDown, 999, 1) GUICtrlSetTip(-1, "Temps avant qu'une info bulle vous prévienne qu'il reste un certain temps avant l'exécution de l'action choisie." & @CRLF & "Par défaut, 59 secondes avant que l'action soit effectuée.") Global $AproposGroupPreventionCheckBox = GUICtrlCreateCheckbox("Activer", 15, 77) GUICtrlSetTip(-1, "Activer la prévention") Global $ReadSettingsPreventCheck = RegRead("HKEY_CURRENT_USER\Software\The End", "PreventEnable") GUICtrlSetOnEvent(-1, "AproposPreventCheckBox") If $ReadSettingsPreventCheck = "Enable" Then GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetState($AproposGroupPreventionInput, $GUI_ENABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_ENABLE) Else GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetState($AproposGroupPreventionInput, $GUI_DISABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_DISABLE) EndIf GUICtrlCreateLabel("secondes", 140, 79, 70, 20) GUICtrlSetTip(-1, "Temps avant qu'une info bulle vous prévienne qu'il reste un certain temps avant l'exécution de l'action choisie." & @CRLF & "Par défaut, 59 secondes avant que l'action soit effectuée.") $AproposGroupPreventionBoutonValider = GUICtrlCreateButton("Enregistrer", 195, 79, 60, 19) GUICtrlSetTip(-1, "Enregistrer") GUICtrlSetOnEvent(-1, "AproposPrevent") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateTabItem("") $Time = GUICtrlCreateLabel(_DateTimeFormat(_NowCalc(), 5), 210, 5, 50, 13, $SS_Center) ; L'heure. ;========================================= ;========================================= TraySetPauseIcon("Shell32.dll", 26) $etat = TrayCreateMenu("État") $afficher = TrayCreateItem("Afficher la fenêtre", $etat, -1, 1) TrayItemSetOnEvent(-1, "Afficher") $masquer = TrayCreateItem("Masquer la fenêtre", $etat, -1, 1) TrayItemSetOnEvent(-1, "Masquer") TrayItemSetState($afficher, $TRAY_CHECKED) $quitter = TrayCreateItem("Quitter") TrayItemSetOnEvent(-1, "Quitter") ;========================================= ;========================================= GUISetState(@SW_SHOW) AdlibRegister("UpdateHourFR", 100) ;========================================= While 1 Sleep(1000) WEnd ElseIf $ReadSettingsLng = "EN" Then $GUIPrincipale = GUICreate("The End", 273, 242, -1, -1) ; Le programme démarre en Français GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $Tab = GUICtrlCreateTab(0, 0, 275, 500, $TCS_HOTTRACK) $MinuteurTab = GUICtrlCreateTabItem("Timer") GUICtrlSetTip(-1, "Timer. Performs an action after a delay") $MinuteurBoutonValider = GUICtrlCreateButton("Ok", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 253) GUICtrlSetOnEvent(-1, "TimerOkButton") GUICtrlSetTip(-1, "Start the timer") $MinuteurBoutonAide = GUICtrlCreateButton(" Help", 140, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 24) GUICtrlSetCursor(-1, 4) GUICtrlSetOnEvent(-1, "TimerHelpButton") GUICtrlSetTip(-1, "Help on the timer") $MinuteurInputHeure = GUICtrlCreateInput("0", 10, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Number of hours") $MinuteurUpDownHeure = GUICtrlCreateUpdown($MinuteurInputHeure, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 99, 0) $MinuteurInputMin = GUICtrlCreateInput("0", 95, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Number of minutes") $MinuteurUpDownMin = GUICtrlCreateUpdown($MinuteurInputMin, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $MinuteurInputSec = GUICtrlCreateInput("0", 190, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Number of seconds") $MinuteurUpDownSec = GUICtrlCreateUpdown($MinuteurInputSec, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $MinuteurTxtHeure = GUICtrlCreateLabel("H", 75, 35, 26, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $MinuteurTxtMin = GUICtrlCreateLabel("M", 160, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $MinuteurTxtSec = GUICtrlCreateLabel("S", 255, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") Global $MinuteurCombo = GUICtrlCreateCombo("", 32, 90, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1, "Shutdown|Reboot|Logoff|Standby|Hibernate|Other", "Shutdown") GUICtrlSetTip(-1, "Select an action to perform." & @CRLF & "To boot a program, select Other and complete the path of the program thereafter.") GUICtrlSetOnEvent(-1, "MinuteurComboEventEN") $MinuteurTxtAutre = GUICtrlCreateLabel("Other action :", 32, 120, 77, 19) GUICtrlSetFont(-1, 10, 400, 4, "Times New Roman") $MinuteurInputOtherAction = GUICtrlCreateInput("", 32, 135, 177, 21) GUICtrlSetTip(-1, "Path of the program") $MinuteurBoutonOther = GUICtrlCreateButton(". . .", 216, 135, 25, 21) GUICtrlSetTip(-1, "Windows Explorer to search path's program") GUICtrlSetOnEvent(-1, "TimerOtherButton") GUICtrlSetState($MinuteurTxtAutre, $GUI_HIDE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_HIDE) GUICtrlSetState($MinuteurBoutonOther, $GUI_HIDE) $MinuteurTxtCountdown = GUICtrlCreateLabel("No current timer", 10, 160, 250, 38, $SS_Center) GUICtrlSetFont(-1, 9, 400, 1, "Times New Roman") GUICtrlSetTip(-1, "Countdown") ;========================================================== ;========================================================== ;========================================================== $ProgrammateurTab = GUICtrlCreateTabItem("Programmer") GUICtrlSetTip(-1, "Programmer. Performs an action at a specific time.") $ProgInputHeure = GUICtrlCreateInput("0", 10, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Hour at which the action must be performed") $ProgUpDownHeure = GUICtrlCreateUpdown($ProgInputHeure, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 23, 0) $ProgInputMin = GUICtrlCreateInput("0", 95, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Minute at which the action must be performed") $ProgUpDownMin = GUICtrlCreateUpdown($ProgInputMin, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $ProgInputSec = GUICtrlCreateInput("0", 190, 35, 65, 35, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 18, 400, 0, "Arial") GUICtrlSetTip(-1, "Second at which the action must be performed") $ProgUpDownSec = GUICtrlCreateUpdown($ProgInputSec, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 59, 0) $ProgTxtHeure = GUICtrlCreateLabel("H", 75, 35, 26, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgTxtMin = GUICtrlCreateLabel("M", 160, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgTxtSec = GUICtrlCreateLabel("S", 255, 35, 56, 42) GUICtrlSetFont(-1, 17, 400, 0, "Arial Black") $ProgBoutonValider = GUICtrlCreateButton("Ok", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 253) GUICtrlSetOnEvent(-1, "ProgOkButton") GUICtrlSetTip(-1, "Start") $ProgBoutonAide = GUICtrlCreateButton(" Help", 140, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 24) GUICtrlSetCursor(-1, 4) GUICtrlSetOnEvent(-1, "ProgHelpButton") GUICtrlSetTip(-1, "Help on the programmer") $ProgCombo = GUICtrlCreateCombo("", 32, 90, 201, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1, "Shutdown|Reboot|Logoff|Standby|Hibernate|Other", "Shutdown") GUICtrlSetTip(-1, "Select an action to perform" & @CRLF & " To boot a program, select Other and complete the path of the program thereafter.") GUICtrlSetOnEvent(-1, "ProgComboEventEN") $ProgTxtAutre = GUICtrlCreateLabel("Other action :", 32, 120, 77, 19) GUICtrlSetFont(-1, 10, 400, 4, "Times New Roman") GUICtrlSetState(-1, $GUI_HIDE) $ProgInputOtherAction = GUICtrlCreateInput("", 32, 135, 177, 21) GUICtrlSetTip(-1, "Path of the program") GUICtrlSetState(-1, $GUI_HIDE) $ProgBoutonOther = GUICtrlCreateButton(". . .", 216, 135, 25, 21) GUICtrlSetTip(-1, "Windows Explorer to search path's program") GUICtrlSetOnEvent(-1, "ProgOtherButton") GUICtrlSetState(-1, $GUI_HIDE) $ProgTxtCountdown = GUICtrlCreateLabel("No current programmer", 10, 160, 250, 38, $SS_Center) GUICtrlSetFont(-1, 9, 400, 1, "Times New Roman") GUICtrlSetTip(-1, "Countdown") ;=============================================== ;=============================================== $AproposTab = GUICtrlCreateTabItem("About ...") GUICtrlSetTip(-1, "About the program") $AproposGroupThanks = GUICtrlCreateGroup("Thank you to", 8, 185, 257, 50) GUICtrlSetTip(-1, "Thank you to") $AproposGroupThanksJguinch = GUICtrlCreateLabel("Jguinch, Mikell, Tlem and to the AutoIT's forums (Fr - En)", 16, 200, 240, 30) GUICtrlSetTip(-1, "Thank you to") $AproposGroupTestedOn = GUICtrlCreateGroup("Testé sur", 8, 135, 257, 50) GUICtrlSetTip(-1, "Tested on") $AproposGroupTestedOnAutoit = GUICtrlCreateLabel("AutoIT version : v3.3.8.1", 16, 150, 132, 19) GUICtrlSetTip(-1, "AutoIT") $AproposGroupTestedOnWindows = GUICtrlCreateLabel("Windows 7 Ultimate 64 Bits", 16, 165, 141, 19) GUICtrlSetTip(-1, "Windows") GUICtrlCreateGroup("", -99, -99, 1, 1) $AproposGroupCree = GUICtrlCreateGroup("Created by", 8, 99, 257, 35) GUICtrlSetTip(-1, "Created by") $AproposGroupCreePar = GUICtrlCreateLabel("Ricardo R. (ricardog@live.be)", 16, 115, 172, 20) GUICtrlSetTip(-1, "Created by") GUICtrlCreateGroup("", -99, -99, 1, 1) $AproposGroupLangue = GUICtrlCreateGroup("Language (restart the program)", 8, 24, 257, 34) GUICtrlSetTip(-1, "Language of the program") $FrancaisOpt = GUICtrlCreateRadio("Français", 60, 37, 81, 17) GUICtrlSetOnEvent(-1, "Aproposfr") GUICtrlSetTip(-1, "Put the program in French" & @CRLF & "The program will reboot automatically") $AnglaisOpt = GUICtrlCreateRadio("English", 150, 37, 81, 17) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetOnEvent(-1, "Aproposen") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetTip($AnglaisOpt, "The program is in English") $AproposGroupPrevention = GUICtrlCreateGroup("Time before the prevention of the action", 8, 58, 257, 38) GUICtrlSetTip(-1, "Time before a tooltip warn you there is still some time before the execution of the selected action.") GUICtrlSetTip(-1, "Time before ") Global $ReadSettingsPrevent = RegRead("HKEY_CURRENT_USER\Software\The End", "PreventTime") If $ReadSettingsPrevent = "" Then $ReadSettingsPrevent = 59 EndIf Global $AproposGroupPreventionInput = GUICtrlCreateInput($ReadSettingsPrevent, 85, 71, 50, 18, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER)) GUICtrlSetTip(-1, "Time before a tooltip warn you there is still some time before the execution of the selected action." & @CRLF & "Default is 59.") $AproposGroupPreventionInputUpDown = GUICtrlCreateUpdown($AproposGroupPreventionInput, $UDS_NOTHOUSANDS + $UDS_ARROWKEYS) GUICtrlSetLimit($AproposGroupPreventionInputUpDown, 999, 1) Global $AproposGroupPreventionCheckBox = GUICtrlCreateCheckbox("Enable", 15, 70) GUICtrlSetTip(-1, "Enable the prevention") Global $ReadSettingsPreventCheck = RegRead("HKEY_CURRENT_USER\Software\The End", "PreventEnable") GUICtrlSetOnEvent(-1, "AproposPreventCheckBox") If $ReadSettingsPreventCheck = "Enable" Then GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetState($AproposGroupPreventionInput, $GUI_ENABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_ENABLE) Else GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetState($AproposGroupPreventionInput, $GUI_DISABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_DISABLE) EndIf GUICtrlCreateLabel("seconds", 140, 72, 70, 20) GUICtrlSetTip(-1, "Time before a tooltip warn you there is still some time before the execution of the selected action." & @CRLF & "Default is 59") $AproposGroupPreventionBoutonValider = GUICtrlCreateButton("Save", 195, 72, 60, 19) GUICtrlSetTip(-1, "Save the settings") GUICtrlSetOnEvent(-1, "AproposPrevent") GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateTabItem("") $Time = GUICtrlCreateLabel(_DateTimeFormat(_NowCalc(), 5), 170, 5, 100, 13, $SS_Center) ; L'heure. ;========================================= ;========================================= TraySetPauseIcon("Shell32.dll", 26) $etat = TrayCreateMenu("State") $afficher = TrayCreateItem("Show the window", $etat, -1, 1) TrayItemSetOnEvent(-1, "Afficher") $masquer = TrayCreateItem("Hide the windows", $etat, -1, 1) TrayItemSetOnEvent(-1, "Masquer") TrayItemSetState($afficher, $TRAY_CHECKED) $quitter = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "Quit") ;========================================= ;========================================= GUISetState(@SW_SHOW) AdlibRegister("UpdateHourEN", 100) ;========================================= While 1 Sleep(1000) WEnd Else #region ### START Koda GUI section ### Form= $GUIChoixLangue = GUICreate("Langue", 168, 137, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "Quitter") $Langue = GUICtrlCreateLabel("Choisissez votre langue", 18, 8, 131, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Langue2 = GUICtrlCreateLabel("Choose your language", 21, 29, 125, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Francais = GUICtrlCreateRadio("Français", 43, 72, 81, 25) GUICtrlSetFont(-1, 13, 400, 0, "Arial") $Anglais = GUICtrlCreateRadio("English", 47, 97, 73, 25) GUICtrlSetFont(-1, 13, 400, 0, "Arial") $Langue3 = GUICtrlCreateGroup("Langue/ Language", 8, 48, 153, 81) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 If GUICtrlRead($Francais) = 1 Then RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "FR") RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventEnable", "REG_SZ", "Enable") RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventTime", "REG_SZ", "59") _ScriptRestart() ElseIf GUICtrlRead($Anglais) = 1 Then RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "EN") RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventEnable", "REG_SZ", "Enable") RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventTime", "REG_SZ", "59") _ScriptRestart() EndIf WEnd EndIf Func Quitter() If GUICtrlRead($MinuteurTxtCountdown) <> "Pas de minuteur en cours" Then If MsgBox(262420, "Attention", "Un minuteur est en cours, voulez-vous quitter et annuler ce minuteur ?") = 6 Then Exit EndIf ElseIf GUICtrlRead($ProgTxtCountdown) <> "Pas de programmateur en cours" Then If MsgBox(262420, "Attention", "Un programmateur est en cours, voulez-vous quitter et annuler ce programmateur ?") = 6 Then Exit EndIf Else Exit EndIf EndFunc ;==>Quitter Func Quit() If GUICtrlRead($MinuteurTxtCountdown) <> "No current timer" Then If MsgBox(262420, "Warning", "A timer is being, would you absolutely quit and cancel the timer ?") = 6 Then Exit EndIf ElseIf GUICtrlRead($ProgTxtCountdown) <> "No current programmer" Then If MsgBox(262420, "Warning", "A programmer is being, would you absolutely quit and cancel the programer ?") = 6 Then Exit EndIf Else Exit EndIf EndFunc ;==>Quit Func Afficher() GUISetState(@SW_SHOW) TrayItemSetState($afficher, $TRAY_CHECKED) TrayItemSetState($masquer, $TRAY_UNCHECKED) EndFunc ;==>Afficher Func Masquer() GUISetState(@SW_HIDE) TrayItemSetState($masquer, $TRAY_CHECKED) TrayItemSetState($afficher, $TRAY_UNCHECKED) EndFunc ;==>Masquer Func _ScriptRestart($fExit = 1) If @Compiled = 1 Then Run(FileGetShortName(@ScriptFullPath)) Else Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf Exit EndFunc ;==>_ScriptRestart Func MinuteurBoutonAide() MsgBox(32, "Aide pour le minuteur", "L'option minuteur, comme son nom l'indique, fonctionne comme un minuteur. C'est à dire que vous choisissez un nombre d'heures, de minutes et de secondes avant que l'action choisie soit effectuée." & @CRLF & @CRLF & "Procédez comme suit pour utiliser le minuteur :" & @CRLF & "1. A l'aide des flèches, du clavier, de la molette de la souris ou des flèches du clavier, entrez un nombre pour chaque option : Heure, minute et seconde" & @CRLF & "2. Sélectionnez une action à effectuer dans la liste déroulante." & @CRLF & " 2.1. Si vous avez sélectionner Autre, indiquer le chemin du programme (que vous pouvez trouver grâce à l'explorateur Windows en cliquant sur le bouton à droite) dans la zone de saisie juste en dessous." & @CRLF & "3. Cliquez sur valider et le minuteur se lance." & @CRLF & " 3.1 Vous verrez un décompte se lancer qui indique le temps avant que l'action choisie soit effectuée." & @CRLF & " 3.2 Vous avez la possibilité de mettre le décompte en pause et de le reprendre à tout moment." & @CRLF & @CRLF & @CRLF & @CRLF & "Pour plus d'aide ou d'informations, vous pouvez me contacter par e-mail à : ricardog@live.be") EndFunc ;==>MinuteurBoutonAide Func ProgBoutonAide() MsgBox(32, "Aide pour le programmateur", "L'option programateur, comme son nom l'indique, fonctionne comme un programmateur.C'est à dire que vous choisissez l'heure, la minute et la seconde à laquelle l'action choisie doit être effectuée." & @CRLF & @CRLF & "Procéder comme suit pour utiliser le programateur :" & @CRLF & "1. A l'aide des flèches, du clavier, de la molette de la souris ou des flèches du clavier, indiquez l'heure, la minute et la seconde à laquelle l'action devra être effectuée" & @CRLF & "2. Sélectionnez une action à effectuer dans la liste déroulante." & @CRLF & " 2.1. Si vous avez sélectionner Autre, indiquer le chemin du programme (que vous pouvez trouver grâce à l'explorateur Windows en cliquant sur le bouton à droite) dans la zone de saisie juste en dessous." & @CRLF & "3. Cliquez sur Valider et le programmateur est désormais prêt." & @CRLF & " 3.1. Vous verez un décompte qui vous montrera le nombre d'heures, de minutes et de secondes avant que l'action choisie sera effectuée." & @CRLF & @CRLF & @CRLF & @CRLF & "Pour plus d'aide ou d'informations, vous pouvez me contacter par e-mail à : ricardog@live.be") EndFunc ;==>ProgBoutonAide Func MinuteurBoutonOther() $MinuteurProgrammeSelect = FileOpenDialog("Sélectionnez le programme à lancer", @HomeDrive, "Tout fichier (*.*)", 1) If @error Then MsgBox(16, "Attention", "Aucun fichier n'a été choisi") Else ControlSetText("The End", "", $MinuteurInputOtherAction, $MinuteurProgrammeSelect) EndIf EndFunc ;==>MinuteurBoutonOther Func ProgBoutonOther() $ProgProgrammeSelect = FileOpenDialog("Sélectionnez le programme à lancer", @HomeDrive, "Tout fichier (*.*)", 1) If @error Then MsgBox(16, "Attention", "Aucun fichier n'a été choisi") Else ControlSetText("The End", "", $ProgInputOtherAction, $ProgProgrammeSelect) EndIf EndFunc ;==>ProgBoutonOther Func Aproposfr() RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "FR") _ScriptRestart() EndFunc ;==>Aproposfr Func Aproposen() RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "EN") _ScriptRestart() EndFunc ;==>Aproposen Func AproposPrevent() If GUICtrlRead($AproposGroupPreventionCheckBox) = $GUI_CHECKED Then RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventEnable", "REG_SZ", "Enable") Else RegDelete("HKEY_CURRENT_USER\Software\The End", "PreventEnable") EndIf RegWrite("HKEY_CURRENT_USER\Software\The End", "PreventTime", "REG_SZ", GUICtrlRead($AproposGroupPreventionInput)) EndFunc ;==>AproposPrevent Func MinuteurBoutonValider() Global $MinuteurHeure = GUICtrlRead($MinuteurInputHeure) Global $MinuteurMin = GUICtrlRead($MinuteurInputMin) Global $MinuteurComboSelect = GUICtrlRead($MinuteurCombo) Global $MinuteurInputOther = GUICtrlRead($MinuteurInputOtherAction) Global $NbreMin = $MinuteurHeure * 60 Global $NbreMin2 = $MinuteurMin + $NbreMin Global $NbreSec = GUICtrlRead($MinuteurInputSec) + ($NbreMin2 * 60) Global $NbreMSec = $NbreSec * 1000 Global $PreventionSecsToTime = GUICtrlRead($AproposGroupPreventionInput) If $MinuteurComboSelect = "Arrêter" Then Global $Shutdown = "Arrêt" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() ElseIf $MinuteurComboSelect = "Redémarrer" Then Global $Shutdown = "Redémarrage" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() ElseIf $MinuteurComboSelect = "Fermer la session" Then Global $Shutdown = "Fermeture de session" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() ElseIf $MinuteurComboSelect = "Mettre en veille" Then Global $Shutdown = "Mise en veille" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() ElseIf $MinuteurComboSelect = "Mettre en veille prolongée" Then Global $Shutdown = "Mise en veille prolongée" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() ElseIf $MinuteurComboSelect = "Autre" Then Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) If $MinuteurInputOther = "" Then MsgBox(16, "Attention", "Aucun fichier n'a été choisi") Else Global $Shutdown = "Autre" GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) MinuteurCountdownRestartFR() EndIf EndIf EndFunc ;==>MinuteurBoutonValider Func ProgBoutonValider() Global $ProgHeure = StringFormat("%02i", GUICtrlRead($ProgInputHeure)) Global $ProgMin = StringFormat("%02i", GUICtrlRead($ProgInputMin)) Global $ProgMin2 = $ProgMin - 1 Global $ProgSec = StringFormat("%02i", GUICtrlRead($ProgInputSec)) Global $ProgComboSelect = GUICtrlRead($ProgCombo) Global $ProgInputOther = GUICtrlRead($ProgInputOtherAction) Global $PreventionSecsToTime = GUICtrlRead($AproposGroupPreventionInput) If $ProgHeure < @HOUR And $ProgHeure <> 0 Then Global $actuelheure = Abs(23 + $ProgHeure - @HOUR) ElseIf $ProgHeure > @HOUR And $ProgHeure <> 0 Then Global $actuelheure = Abs($ProgHeure - @HOUR) ElseIf $ProgHeure = @HOUR And $ProgHeure <> 0 Then If $ProgSec > @SEC Then If $ProgMin > @MIN Then Global $actuelheure = 0 Else Global $actuelheure = 23 EndIf ElseIf $ProgSec < @SEC Then If $ProgMin > @MIN Then Global $actuelheure = 0 Else Global $actuelheure = 23 EndIf Else Global $actuelheure = 23 EndIf Else Global $actuelheure = Abs(23 - $ProgHeure - @HOUR) EndIf If $ProgMin > @MIN Then Global $actuelmin = Abs($ProgMin - @MIN) If $actuelmin > 59 Then $actuelmin = $actuelmin - 59 $actuelheure = $actuelheure + 1 EndIf Else Global $actuelmin = Abs(59 + $ProgMin - @MIN) If $actuelmin > 59 Then $actuelmin = $actuelmin - 59 $actuelheure = $actuelheure + 1 EndIf EndIf If $ProgSec > @SEC Then Global $actuelsec = Abs($ProgSec - @SEC) Else Global $actuelsec = Abs(60 + $ProgSec - @SEC) EndIf If $ProgComboSelect = "Autre" Then If $ProgInputOther = "" Then MsgBox(16, "Attention", "Aucun fichier n'a été choisi") Else Global $Shutdown = "Autre" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) EndIf ElseIf $ProgComboSelect = "Arrêter" Then Global $Shutdown = "Arrêt" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) ElseIf $ProgComboSelect = "Redémarrer" Then Global $Shutdown = "Redémarrage" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) ElseIf $ProgComboSelect = "Mettre en veille" Then Global $Shutdown = "Mise en veille" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) ElseIf $ProgComboSelect = "Fermer la session" Then Global $Shutdown = "Fermeture de session" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) ElseIf $ProgComboSelect = "Mettre en veille prolongée" Then Global $Shutdown = "Mise en veille prolongée" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Réinitialiser", 9, 200, 120, 36) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") GUICtrlCreateButton("Masquer", 136, 200, 130, 36) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") AdlibRegister("ProgCountdownFR", 50) EndIf EndFunc ;==>ProgBoutonValider ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ ;============================================================================================ Func TimerHelpButton() MsgBox(32, "Help for the timer", "The timer works like a timer. This means that you choose the number of hours, of minutes and seconds before the performs of the selected action." & @CRLF & @CRLF & "Follow this steps to start a timer :" & @CRLF & "1. Use the arrows, the keyboad, the wheel of the mouse or the arrows of the keyboard to increase to discrease time." & @CRLF & "2. Select an action in the combo." & @CRLF & " 2.1. If you had select Other, enter the path of the file or the program in the input. You can find the path of the program by the Windows's Explorer, you just need click on the right button and select the file or the program." & @CRLF & "Click Ok and the timer begin." & @CRLF & " 3.1. You will see a countdown showing the time before the performs of the action chosen." & @CRLF & " 3.2. You can put in pause and restart the countdown." & @CRLF & @CRLF & @CRLF & @CRLF & "For more help or informations, contact me at : ricardog@live.be") EndFunc ;==>TimerHelpButton Func ProgHelpButton() MsgBox(32, "Help for the programmer", "The programmer works like a programmer. This means that you choose the hour, the minute and the second when the action selected will be perform." & @CRLF & @CRLF & "Follow this steps to start a programmer :" & @CRLF & "1. Use the arrows, the keyboad, the wheel of the mouse or the arrows of the keyboard to adjust the hour, the minute and the second." & @CRLF & "2. Select an action in the combo." & @CRLF & " 2.1. If you had select Other, enter the path of the file or the program in the input. You can find the path of the program by the Windows's Explorer, you just need click on the right button and select the file or the program." & @CRLF & "Click Ok and the programmer is ready." & @CRLF & " 3.1. You will see a countdown showing the time before the performs of the action chosen." & @CRLF & @CRLF &"Note : Use the 24h format for hours"& @CRLF & @CRLF & @CRLF & "For more help or informations, contact me at : ricardog@live.be") EndFunc ;==>ProgHelpButton Func ProgOtherButton() $ProgProgrammeSelect = FileOpenDialog("Select the program to boot", @HomeDrive, "All (*.*)", 1) If @error Then MsgBox(16, "Warning", "No file was selected") Else ControlSetText("The End", "", $ProgInputOtherAction, $ProgProgrammeSelect) EndIf EndFunc ;==>ProgOtherButton Func TimerOtherButton() $ProgProgrammeSelect = FileOpenDialog("Select the program to boot", @HomeDrive, "All (*.*)", 1) If @error Then MsgBox(16, "Warning", "No file was selected") Else ControlSetText("The End", "", $MinuteurInputOtherAction, $ProgProgrammeSelect) EndIf EndFunc ;==>TimerOtherButton Func AboutEN() RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "EN") _ScriptRestart() EndFunc ;==>AboutEN Func AboutFR() RegWrite("HKEY_CURRENT_USER\Software\The End", "LNG", "REG_SZ", "FR") _ScriptRestart() EndFunc ;==>AboutFR Func _TimeHrMin() $hr = @HOUR $min = @MIN If $hr > 12 Then $hr = $hr - 12 $x = "PM" Else $x = "AM" EndIf $timeen = $hr & ":" & $min & ":" & @SEC & " " & $x Return ($timeen) EndFunc ;==>_TimeHrMin Func UpdateHourEN() $now = _TimeHrMin() If $now <> GUICtrlRead($Time) Then GUICtrlSetData($Time, _TimeHrMin()) EndIf EndFunc ;==>UpdateHourEN Func UpdateHourFR() $now = _DateTimeFormat(_NowCalc(), 5) If $now <> GUICtrlRead($Time) Then GUICtrlSetData($Time, _DateTimeFormat(_NowCalc(), 5)) EndIf EndFunc ;==>UpdateHourFR Func _SecsToTime($NbreSec) Local $iHours, $iMins, $iSec_s _TicksToTime($NbreSec * 1000, $iHours, $iMins, $iSec_s) Global $MinuteurCountdown = StringFormat("%02i H %02i Min %02i Sec", $iHours, $iMins, $iSec_s) EndFunc ;==>_SecsToTime Func _SecsToTimePrevent($PreventionSecsToTime) Local $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent _TicksToTime($PreventionSecsToTime * 1000, $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent) Global $Prevention = StringFormat("%02i H %02i Min %02i Sec", $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent) EndFunc ;==>_SecsToTimePrevent Func _SecsToTimeProg($ProgSecsToTime) Local $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent _TicksToTime($ProgSecsToTime * 1000, $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent) Global $ProgCountdown = StringFormat("%02i H %02i Min %02i Sec", $iHoursPrevent, $iMinsPrevent, $iSec_sPrevent) EndFunc ;==>_SecsToTimeProg Func MinuteurCountdownFR() _SecsToTimePrevent($PreventionSecsToTime) If $Shutdown = "Arrêt" Then If GUICtrlRead($MinuteurTxtCountdown) = "Arrêt dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "L'ordinateur va s'éteindre dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Arrêt dans " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Arrêt dans 00 H 00 Min 00 Sec" Then Shutdown(1) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " dans " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Redémarrage" Then If GUICtrlRead($MinuteurTxtCountdown) = "Redémarrage dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "L'ordinateur va redémarrer dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Redémarrage dans " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Redémarrage dans 00 H 00 Min 00 Sec" Then Shutdown(2) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " dans " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Fermeture de session" Then If GUICtrlRead($MinuteurTxtCountdown) = "Fermeture de session dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Fermeture de session dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Fermeture de session dans " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Fermeture de session dans 00 H 00 Min 00 Sec" Then Shutdown(0) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " dans " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Mise en veille" Then If GUICtrlRead($MinuteurTxtCountdown) = "Mise en veille dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Mise en veille dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Mise en veille dans " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Mise en veille dans 00 H 00 Min 00 Sec" Then Shutdown(32) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " dans " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Mise en veille prolongée" Then If GUICtrlRead($MinuteurTxtCountdown) = "Mise en veille prolongée dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Mise en veille prolongée dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Mise en veille prolongée dans " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Mise en veille prolongée dans 00 H 00 Min 00 Sec" Then Shutdown(64) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, " " & $Shutdown & " dans " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Autre" Then $MinuteurTxtFichierSearchSlash = StringInStr($MinuteurInputOther, "\", 1, -1) $MinuteurTxtFichierSuppSlash = StringTrimLeft($MinuteurInputOther, $MinuteurTxtFichierSearchSlash) $MinuteurTxtFichierSuppExtension = StringTrimRight($MinuteurTxtFichierSuppSlash, 4) If GUICtrlRead($MinuteurTxtCountdown) = $Prevention & " avant exécution de " & $MinuteurTxtFichierSuppExtension Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Exécution de " & $MinuteurTxtFichierSuppExtension & " dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $MinuteurCountdown & " avant exécution de " & $MinuteurTxtFichierSuppExtension) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "00 H 00 Min 00 Sec" & " avant exécution de " & $MinuteurTxtFichierSuppExtension Then ShellExecute($MinuteurInputOther) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $MinuteurCountdown & " avant exécution de " & $MinuteurTxtFichierSuppExtension) EndIf EndIf EndFunc ;==>MinuteurCountdownFR Func MinuteurCountdownRestartFR() AdlibRegister("MinuteurCountdownFR", 1000) GUICtrlDelete($MinuteurBoutonValider) Global $MinuteurBoutonPause = GUICtrlCreateButton("Pause", 9, 195, 80, 40) GUICtrlSetImage(-1, "shell32.dll", 16771) GUICtrlSetTip(-1, "Mettre le décompte en pause") GUICtrlSetOnEvent(-1, "MinuteurCountdownPauseFR") GUICtrlDelete($MinuteurBoutonAide) $MinuteurBoutonMasquer = GUICtrlCreateButton("Masquer", 186, 195, 80, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Masquer la fenêtre dans la zone de notification" & @CRLF & "Vous pouvez l'afficher à tout moment via son icône dans la zone de notification") GUICtrlSetState($MinuteurCombo, $GUI_DISABLE) GUICtrlSetState($MinuteurInputHeure, $GUI_DISABLE) GUICtrlSetState($MinuteurInputMin, $GUI_DISABLE) GUICtrlSetState($MinuteurInputSec, $GUI_DISABLE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_DISABLE) $MinuteurBoutonRestart = GUICtrlCreateButton("Réinitialiser", 92, 195, 90, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Réinitialiser") EndFunc ;==>MinuteurCountdownRestartFR Func MinuteurCountdownPauseFR() AdlibUnRegister("MinuteurCountdownFR") GUICtrlDelete($MinuteurBoutonPause) Global $MinuteurBoutonPause = GUICtrlCreateButton("Continuer", 5, 195, 84, 40) GUICtrlSetImage(-1, "shell32.dll", 246) GUICtrlSetOnEvent(-1, "MinuteurCountdownRestartFR") GUICtrlSetTip(-1, "Continuer le décompte") EndFunc ;==>MinuteurCountdownPauseFR Func AproposPreventCheckBox() If GUICtrlRead($AproposGroupPreventionCheckBox) = 1 Then GUICtrlSetState($AproposGroupPreventionInput, $GUI_ENABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_ENABLE) Else GUICtrlSetState($AproposGroupPreventionInput, $GUI_DISABLE) GUICtrlSetState($AproposGroupPreventionInputUpDown, $GUI_DISABLE) EndIf EndFunc ;==>AproposPreventCheckBox Func MinuteurComboEventFR() If GUICtrlRead($MinuteurCombo) = "Autre" Then GUICtrlSetState($MinuteurTxtAutre, $GUI_SHOW) GUICtrlSetState($MinuteurInputOtherAction, $GUI_SHOW) GUICtrlSetState($MinuteurBoutonOther, $GUI_SHOW) Else GUICtrlSetState($MinuteurTxtAutre, $GUI_HIDE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_HIDE) GUICtrlSetState($MinuteurBoutonOther, $GUI_HIDE) EndIf EndFunc ;==>MinuteurComboEventFR Func MinuteurComboEventEN() If GUICtrlRead($MinuteurCombo) = "Other" Then GUICtrlSetState($MinuteurTxtAutre, $GUI_SHOW) GUICtrlSetState($MinuteurInputOtherAction, $GUI_SHOW) GUICtrlSetState($MinuteurBoutonOther, $GUI_SHOW) Else GUICtrlSetState($MinuteurTxtAutre, $GUI_HIDE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_HIDE) GUICtrlSetState($MinuteurBoutonOther, $GUI_HIDE) EndIf EndFunc ;==>MinuteurComboEventEN Func ProgComboEventFR() If GUICtrlRead($ProgCombo) = "Autre" Then GUICtrlSetState($ProgTxtAutre, $GUI_SHOW) GUICtrlSetState($ProgInputOtherAction, $GUI_SHOW) GUICtrlSetState($ProgBoutonOther, $GUI_SHOW) Else GUICtrlSetState($ProgTxtAutre, $GUI_HIDE) GUICtrlSetState($ProgInputOtherAction, $GUI_HIDE) GUICtrlSetState($ProgBoutonOther, $GUI_HIDE) EndIf EndFunc ;==>ProgComboEventFR Func ProgComboEventEN() If GUICtrlRead($ProgCombo) = "Other" Then GUICtrlSetState($ProgTxtAutre, $GUI_SHOW) GUICtrlSetState($ProgInputOtherAction, $GUI_SHOW) GUICtrlSetState($ProgBoutonOther, $GUI_SHOW) Else GUICtrlSetState($ProgTxtAutre, $GUI_HIDE) GUICtrlSetState($ProgInputOtherAction, $GUI_HIDE) GUICtrlSetState($ProgBoutonOther, $GUI_HIDE) EndIf EndFunc ;==>ProgComboEventEN Func ProgCountdownHourFR() If $ProgHeure > @HOUR Then $actueljour = @MDAY Else $actueljour = (@MDAY + 1) EndIf $DateDiff = _DateDiff("s", @YEAR & "/" & @MON & "/" & $actueljour & " " & $ProgHeure & ":" & $ProgMin & ":" & $ProgSec, _NowCalc()) Local $Hour, $mins, $Secs _TicksToTime(Abs($DateDiff * 1000), $Hour, $mins, $Secs) Global $ProgCountdown2 = StringFormat("%02i H %02i Min %02i Sec", $Hour, $mins, $Secs) Global $ProgCountdown = StringReplace($ProgCountdown2, "24", "00", 1) EndFunc ;==>ProgCountdownHourFR Func ProgCountdownHourEN() If $ProgHeure > @HOUR Then $actueljour = @MDAY Else $actueljour = (@MDAY + 1) EndIf $DateDiff = _DateDiff("s", @YEAR & "/" & @MON & "/" & $actueljour & " " & $ProgHeure & ":" & $ProgMin & ":" & $ProgSec, _NowCalc()) Local $Hour, $mins, $Secs _TicksToTime(Abs($DateDiff * 1000), $Hour, $mins, $Secs) Global $ProgCountdown2 = StringFormat("%02i H %02i Min %02i Sec", $Hour, $mins, $Secs) Global $ProgCountdown = StringReplace($ProgCountdown2, "24", "00", 1) EndFunc ;==>ProgCountdownHourEN Func ProgCountdownFR() ProgCountdownHourFR() _SecsToTimePrevent($PreventionSecsToTime) If $Shutdown = "Arrêt" Then If GUICtrlRead($ProgTxtCountdown) = "Arrêt dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "L'ordinateur va s'éteindre dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Arrêt dans 00 H 00 Min 00 Sec" Then Shutdown(1) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " dans " & $ProgCountdown) EndIf ElseIf $Shutdown = "Redémarrage" Then If GUICtrlRead($ProgTxtCountdown) = "Redémarrage dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "L'ordinateur va redémarrer dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Redémarrage dans 00 H 00 Min 00 Sec" Then Shutdown(2) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " dans " & $ProgCountdown) EndIf ElseIf $Shutdown = "Fermeture de session" Then If GUICtrlRead($ProgTxtCountdown) = "Fermeture de session dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Fermeture de session dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Fermeture de session dans 00 H 00 Min 00 Sec" Then Shutdown(0) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " dans " & $ProgCountdown) EndIf ElseIf $Shutdown = "Mise en veille" Then If GUICtrlRead($ProgTxtCountdown) = "Mise en veille dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Mise en veille dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Mise en veille dans 00 H 00 Min 00 Sec" Then Shutdown(32) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " dans " & $ProgCountdown) EndIf ElseIf $Shutdown = "Mise en veille prolongée" Then If GUICtrlRead($ProgTxtCountdown) = "Mise en veille prolongée dans " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Mise en veille prolongée dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = " Mise en veille prolongée dans 00 H 00 Min 00 Sec" Then Shutdown(64) Exit Else GUICtrlSetData($ProgTxtCountdown, " " & $Shutdown & " dans " & $ProgCountdown) EndIf ElseIf $Shutdown = "Autre" Then $MinuteurTxtFichierSearchSlash = StringInStr($ProgInputOther, "\", 1, -1) $MinuteurTxtFichierSuppSlash = StringTrimLeft($ProgInputOther, $MinuteurTxtFichierSearchSlash) $MinuteurTxtFichierSuppExtension = StringTrimRight($MinuteurTxtFichierSuppSlash, 4) If GUICtrlRead($ProgTxtCountdown) = $Prevention & " avant exécution de " & $MinuteurTxtFichierSuppExtension Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Attention", "Exécution de " & $MinuteurTxtFichierSuppExtension & " dans " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "00 H 00 Min 00 Sec" & " avant exécution de " & $MinuteurTxtFichierSuppExtension Then ShellExecute($ProgInputOther) Exit Else GUICtrlSetData($ProgTxtCountdown, $ProgCountdown & " avant exécution de " & $MinuteurTxtFichierSuppExtension) EndIf EndIf EndFunc ;==>ProgCountdownFR Func TimerOkButton() Global $MinuteurHeure = GUICtrlRead($MinuteurInputHeure) Global $MinuteurMin = GUICtrlRead($MinuteurInputMin) Global $MinuteurComboSelect = GUICtrlRead($MinuteurCombo) Global $MinuteurInputOther = GUICtrlRead($MinuteurInputOtherAction) Global $NbreMin = $MinuteurHeure * 60 Global $NbreMin2 = $MinuteurMin + $NbreMin Global $NbreSec = GUICtrlRead($MinuteurInputSec) + ($NbreMin2 * 60) Global $NbreMSec = $NbreSec * 1000 Global $PreventionSecsToTime = GUICtrlRead($AproposGroupPreventionInput) If $MinuteurComboSelect = "Shutdown" Then Global $Shutdown = "Shutdown" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() ElseIf $MinuteurComboSelect = "Reboot" Then Global $Shutdown = "Reboot" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() ElseIf $MinuteurComboSelect = "Logoff" Then Global $Shutdown = "Logoff" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() ElseIf $MinuteurComboSelect = "Standby" Then Global $Shutdown = "Standby" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() ElseIf $MinuteurComboSelect = "Hibernate" Then Global $Shutdown = "Hibernate" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() ElseIf $MinuteurComboSelect = "Other" Then Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) If $MinuteurInputOther = "" Then MsgBox(16, "Warning", "No file chosen !") Else Global $Shutdown = "Other" GUICtrlDelete($ProgrammateurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($MinuteurBoutonOther, $GUI_DISABLE) TimerCountdownRestartEN() EndIf EndIf EndFunc ;==>TimerOkButton Func ProgOkButton() Global $ProgHeure = StringFormat("%02i", GUICtrlRead($ProgInputHeure)) Global $ProgMin = StringFormat("%02i", GUICtrlRead($ProgInputMin)) Global $ProgMin2 = $ProgMin - 1 Global $ProgSec = StringFormat("%02i", GUICtrlRead($ProgInputSec)) Global $ProgComboSelect = GUICtrlRead($ProgCombo) Global $ProgInputOther = GUICtrlRead($ProgInputOtherAction) Global $PreventionSecsToTime = GUICtrlRead($AproposGroupPreventionInput) If $ProgHeure < @HOUR And $ProgHeure <> 0 Then Global $actuelheure = Abs(23 + $ProgHeure - @HOUR) ElseIf $ProgHeure > @HOUR And $ProgHeure <> 0 Then Global $actuelheure = Abs($ProgHeure - @HOUR) ElseIf $ProgHeure = @HOUR And $ProgHeure <> 0 Then If $ProgSec > @SEC Then If $ProgMin > @MIN Then Global $actuelheure = 0 Else Global $actuelheure = 23 EndIf ElseIf $ProgSec < @SEC Then If $ProgMin > @MIN Then Global $actuelheure = 0 Else Global $actuelheure = 23 EndIf Else Global $actuelheure = 23 EndIf Else Global $actuelheure = Abs(23 - $ProgHeure - @HOUR) EndIf If $ProgMin > @MIN Then Global $actuelmin = Abs($ProgMin - @MIN) If $actuelmin > 59 Then $actuelmin = $actuelmin - 59 $actuelheure = $actuelheure + 1 EndIf Else Global $actuelmin = Abs(59 + $ProgMin - @MIN) If $actuelmin > 59 Then $actuelmin = $actuelmin - 59 $actuelheure = $actuelheure + 1 EndIf EndIf If $ProgSec > @SEC Then Global $actuelsec = Abs($ProgSec - @SEC) Else Global $actuelsec = Abs(60 + $ProgSec - @SEC) EndIf If $ProgComboSelect = "Other" Then If $ProgInputOther = "" Then MsgBox(16, "Warning", "No file chosen") Else Global $Shutdown = "Other" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 200, 120, 38) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 200, 130, 38) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) EndIf ElseIf $ProgComboSelect = "Shutdown" Then Global $Shutdown = "Shutdown" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 195, 130, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) ElseIf $ProgComboSelect = "Reboot" Then Global $Shutdown = "Reboot" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 195, 130, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can sow the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) ElseIf $ProgComboSelect = "Standby" Then Global $Shutdown = "Standby" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 195, 130, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) ElseIf $ProgComboSelect = "Logoff" Then Global $Shutdown = "Logoff" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 195, 130, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) ElseIf $ProgComboSelect = "Hibernate" Then Global $Shutdown = "Hibernate" Global $AproposGroupPreventionCheckBoxRead = GUICtrlRead($AproposGroupPreventionCheckBox) GUICtrlDelete($MinuteurTab) GUICtrlDelete($AproposTab) GUICtrlSetState($ProgInputHeure, $GUI_DISABLE) GUICtrlSetState($ProgInputMin, $GUI_DISABLE) GUICtrlSetState($ProgInputSec, $GUI_DISABLE) GUICtrlSetState($ProgCombo, $GUI_DISABLE) GUICtrlSetState($ProgInputOtherAction, $GUI_DISABLE) GUICtrlSetState($ProgBoutonOther, $GUI_DISABLE) GUICtrlDelete($ProgBoutonValider) GUICtrlDelete($ProgBoutonAide) GUICtrlCreateButton("Reset", 9, 195, 120, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") GUICtrlCreateButton("Hide", 136, 195, 130, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") AdlibRegister("ProgCountdownEN", 50) EndIf EndFunc ;==>ProgOkButton Func TimerCountdownRestartEN() AdlibRegister("TimerCountdownEN", 1000) GUICtrlDelete($MinuteurBoutonValider) Global $MinuteurBoutonPause = GUICtrlCreateButton("Pause", 9, 195, 80, 40) GUICtrlSetImage(-1, "shell32.dll", 16771) GUICtrlSetTip(-1, "Pause the countdown") GUICtrlSetOnEvent(-1, "TimerCountdownPauseEN") GUICtrlDelete($MinuteurBoutonAide) $MinuteurBoutonMasquer = GUICtrlCreateButton("Hide", 186, 195, 80, 40) GUICtrlSetImage(-1, "shell32.dll", 16750) GUICtrlSetOnEvent(-1, "Masquer") GUICtrlSetTip(-1, "Hide the window" & @CRLF & "You can show the window by the tray icon") GUICtrlSetState($MinuteurCombo, $GUI_DISABLE) GUICtrlSetState($MinuteurInputHeure, $GUI_DISABLE) GUICtrlSetState($MinuteurInputMin, $GUI_DISABLE) GUICtrlSetState($MinuteurInputSec, $GUI_DISABLE) GUICtrlSetState($MinuteurInputOtherAction, $GUI_DISABLE) $MinuteurBoutonRestart = GUICtrlCreateButton("Reset", 92, 195, 90, 40) GUICtrlSetImage(-1, "shell32.dll", 16739) GUICtrlSetOnEvent(-1, "_ScriptRestart") GUICtrlSetTip(-1, "Reset") EndFunc ;==>TimerCountdownRestartEN Func TimerCountdownPauseEN() AdlibUnRegister("TimerCountdownEN") GUICtrlDelete($MinuteurBoutonPause) Global $MinuteurBoutonPause = GUICtrlCreateButton("Continue", 5, 195, 84, 40) GUICtrlSetImage(-1, "shell32.dll", 246) GUICtrlSetOnEvent(-1, "TimerCountdownRestartEN") GUICtrlSetTip(-1, "Continue the countdown") EndFunc ;==>TimerCountdownPauseEN Func TimerCountdownEN() _SecsToTimePrevent($PreventionSecsToTime) If $Shutdown = "Shutdown" Then If GUICtrlRead($MinuteurTxtCountdown) = "Shutdown in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "The computer will be shutdown in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Shutdown in " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Shutdown in 00 H 00 Min 00 Sec" Then Shutdown(1) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " in " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Reboot" Then If GUICtrlRead($MinuteurTxtCountdown) = "Reboot in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "The computer will be reboot in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Reboot in " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Reboot in 00 H 00 Min 00 Sec" Then Shutdown(2) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " in " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Logoff" Then If GUICtrlRead($MinuteurTxtCountdown) = "Logoff in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Logoff in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Logoff in " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Logoff in 00 H 00 Min 00 Sec" Then Shutdown(0) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " in " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Standby" Then If GUICtrlRead($MinuteurTxtCountdown) = "Standby in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Standby in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Standby in " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Standby in 00 H 00 Min 00 Sec" Then Shutdown(32) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $Shutdown & " in " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Hibernate" Then If GUICtrlRead($MinuteurTxtCountdown) = "Hibernate in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Hibernate in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, "Hibernate in " & $MinuteurCountdown) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "Hibernate in 00 H 00 Min 00 Sec" Then Shutdown(64) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, " " & $Shutdown & " in " & $MinuteurCountdown) EndIf ElseIf $Shutdown = "Other" Then $MinuteurTxtFichierSearchSlash = StringInStr($MinuteurInputOther, "\", 1, -1) $MinuteurTxtFichierSuppSlash = StringTrimLeft($MinuteurInputOther, $MinuteurTxtFichierSearchSlash) $MinuteurTxtFichierSuppExtension = StringTrimRight($MinuteurTxtFichierSuppSlash, 4) If GUICtrlRead($MinuteurTxtCountdown) = $Prevention & " before execution of " & $MinuteurTxtFichierSuppExtension Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Execution of " & $MinuteurTxtFichierSuppExtension & " in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) EndIf $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $MinuteurCountdown & " before execution of " & $MinuteurTxtFichierSuppExtension) ElseIf GUICtrlRead($MinuteurTxtCountdown) = "00 H 00 Min 00 Sec" & " before execution of " & $MinuteurTxtFichierSuppExtension Then ShellExecute($MinuteurInputOther) Exit Else $NbreSec = $NbreSec - 1 _SecsToTime($NbreSec) GUICtrlSetData($MinuteurTxtCountdown, $MinuteurCountdown & " before execution of " & $MinuteurTxtFichierSuppExtension) EndIf EndIf EndFunc ;==>TimerCountdownEN Func ProgCountdownEN() ProgCountdownHourEN() _SecsToTimePrevent($PreventionSecsToTime) If $Shutdown = "Shutdown" Then If GUICtrlRead($ProgTxtCountdown) = "Shutdown in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "The computer will be shutdown in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Shutdown in 00 H 00 Min 00 Sec" Then Shutdown(1) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " in " & $ProgCountdown) EndIf ElseIf $Shutdown = "Reboot" Then If GUICtrlRead($ProgTxtCountdown) = "Reboot in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "The computer will be reboot in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Reboot in 00 H 00 Min 00 Sec" Then Shutdown(2) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " in " & $ProgCountdown) EndIf ElseIf $Shutdown = "Logoff" Then If GUICtrlRead($ProgTxtCountdown) = "Logoff in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Logoff in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Logoff in 00 H 00 Min 00 Sec" Then Shutdown(0) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " in " & $ProgCountdown) EndIf ElseIf $Shutdown = "Standby" Then If GUICtrlRead($ProgTxtCountdown) = "Standby in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Standby in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "Standby in 00 H 00 Min 00 Sec" Then Shutdown(32) Exit Else GUICtrlSetData($ProgTxtCountdown, $Shutdown & " in " & $ProgCountdown) EndIf ElseIf $Shutdown = "Hibernate" Then If GUICtrlRead($ProgTxtCountdown) = "Hibernate in " & $Prevention Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Hibernate in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = " Hibernate in 00 H 00 Min 00 Sec" Then Shutdown(64) Exit Else GUICtrlSetData($ProgTxtCountdown, " " & $Shutdown & " in " & $ProgCountdown) EndIf ElseIf $Shutdown = "Other" Then $MinuteurTxtFichierSearchSlash = StringInStr($ProgInputOther, "\", 1, -1) $MinuteurTxtFichierSuppSlash = StringTrimLeft($ProgInputOther, $MinuteurTxtFichierSearchSlash) $MinuteurTxtFichierSuppExtension = StringTrimRight($MinuteurTxtFichierSuppSlash, 4) If GUICtrlRead($ProgTxtCountdown) = $Prevention & " before execution of " & $MinuteurTxtFichierSuppExtension Then If $AproposGroupPreventionCheckBoxRead = $GUI_CHECKED Then TrayTip("Warning", "Execution of " & $MinuteurTxtFichierSuppExtension & " in " & $Prevention, 2, 2) _WinAPI_FlashWindowEx($GUIPrincipale, 3, 5) Sleep(1000) GUICtrlSetData($ProgTxtCountdown, "b") EndIf ElseIf GUICtrlRead($ProgTxtCountdown) = "00 H 00 Min 00 Sec" & " before execution of " & $MinuteurTxtFichierSuppExtension Then ShellExecute($ProgInputOther) Exit Else GUICtrlSetData($ProgTxtCountdown, $ProgCountdown & " before execution of " & $MinuteurTxtFichierSuppExtension) EndIf EndIf EndFunc ;==>ProgCountdownEN