SANOGO Posted June 2, 2019 Share Posted June 2, 2019 Hello, here is a part of my code, my concern is the button 4 which is the button to leave it does not work. I do not know if I put the code in the right place. Thank you for your help. Global $Hostname2 = GUICtrlCreateInput("192.168.0.1", 120, 85, 209, 21) ; zone de texte hostname 2 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur $Button4 = GUICtrlCreateButton("Quitter", 136, 512, 107, 41, BitOR($BS_DEFPUSHBUTTON,$WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button4 Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 Is this your total code? I need to see the runnable code that demonstrates the issue. This piece of code can't be ran as is. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 (edited) 1 hour ago, Jos said: Est-ce votre code total? J'ai besoin de voir le code exécutable qui illustre le problème. Ce morceau de code ne peut pas être testé tel quel. Jos expandcollapse popup#NoTrayIcon; bibliothèque pour les icônes #include <GuiConstantsEx.au3>; biblithèque constante #include <ButtonConstants.au3>; bibliothèque pour le bouton #include <GUIConstantsEx.au3> #include <WindowsConstants.au3>; bibliothèque constante windows #include <GuiStatusBar.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> HotKeySet ("{ESC}", "_hkExitApp"); quitter l'application Opt ("GUIOnEventMode", 1); utiliser en mode événement Global $ sURL; URL globale 1 Global $ sURL2; URL globale 2 Global $ sURL3; URL globale 3 Global $ sURL4; URL globale 4 Global $ sURL5; URL globale 5 Global $ sURL6; URL globale 6 Global $ sURL7; URL globale 7 Global $ sURL8; URL globale 8 Global $ sURL9; URL globale 9 Global $ sURL10; URL globale 10 Global $ sURL11; URL globale 11 Global $ sURL12; URL globale 12 $ Form1 = GUICreate (" Application: Système de diagnostic V1.0", 832, 629, -1, -1); formulaire global GUISetOnEvent ($ GUI_EVENT_CLOSE, "_hkExitApp"); définir un événement de sortie et utiliser une constante pour qu'il n'est pas beaucoup de chiffres magiques GUISetBkColor (0xABABAB) ; création des étiquettes pour l'étiquetage des commandes GUICtrlCreateLabel ("Hote 1:", 20, 60, 90, 17); label host 1 GUICtrlCreateLabel ("Hote 2:", 20, 85, 90, 17); label host 2 GUICtrlCreateLabel ("Hote 3:", 20, 110, 90, 17); label host 3 GUICtrlCreateLabel ("Hote 4:", 20, 135, 90, 17); label host 4 GUICtrlCreateLabel ("Hote 5:", 20, 160, 90, 17); label host 5 GUICtrlCreateLabel ("Hote 6:", 20, 185, 90, 17); label host 6 GUICtrlCreateLabel ("Hote 7:", 20, 210, 90, 17); label host 7 ; création des étiquettes pour l'état des services GUICtrlCreateLabel ("Hote 8:", 428, 60, 90, 17); label host 8 GUICtrlCreateLabel ("Hote 9:", 428, 85, 90, 17); label host 9 GUICtrlCreateLabel ("Hote 10:", 428, 110, 90, 17); étiquette hôte 10 GUICtrlCreateLabel ("Hote 11:", 428, 135, 90, 17); label hôte 11 GUICtrlCreateLabel ("Hote 12:", 428, 160, 90, 17); label host 12 création de zones de texte pour l'étiquetage de ping Global $ Hostname1 = GUICtrlCreateInput ("" 10.10.7.1 ", 120, 60, 209, 21); zone de texte nom d'hôte 1 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (- 1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur Global $ Hostname2 = GUICtrlCreateInput ("10.10.7.2", 120, 85, 209, 21); zone de texte nom d'hôte 2 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur Global $ Hostname3 = GUICtrlCreateInput ("" 10.10.7.3 ", 120, 110, 209, 21) nom de zone hôte texte 3 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, 0x00ff00); couleur Global $ Hostname4 = GUICtrlCreateInput ("" 10.10.7.4 ", 120, 135, 209, 21) nom de zone de texte nom d'hôte 4 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur Global $ Hostname5 = GUICtrlCreateInput ("" 10.10.7.5 ", 120, 160, 209, 21) nom de zone de texte 5 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, 0x00ff00); couleur Global $ Hostname6 = GUICtrlCreateInput ("" 10.10.7.6 ", 120, 185, 209, 21) nom de zone de texte nom d'hôte 6 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur Global $ Hostname7 = GUICtrlCreateInput ("" 10.10.7.7 ", 120, 210, 209, 21) nom de zone de texte nom d'hôte 7 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur création de zones de texte pour les services Global $ Hostname8 = GUICtrlCreateInput ("" 10.10.7.8 ", 530, 60, 209, 21); zone de texte nom d’hôte 8 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (- 1, 0) GUICtrlSetColor (-1, 0x00ff00); couleur Global $ Hostname9 = GUICtrlCreateInput ("" 10.10.7.9 ", 530, 85, 209, 21) nom de la zone texte 9 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, $ GUItrlSetColor (-1, 0x00ff00); couleur Global $ Hostname10 = GUICtrlCreateInput ("" 10.10.7.10 ", 530, 110, 209, 21) nom de zone nom d'hôte 10 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, $ GUItrlSetColor (-1, 0x00ff00); couleur Global $ Hostname11 = GUICtrlCreateInput ("" 10.10.7.11 ", 530, 135, 209, 21) nom de zone de texte nom d'hôte 11 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, $ GUItrlSetColor (-1, 0x00ff00); couleur Global $ Hostname12 = GUICtrlCreateInput ("" 10.10.7.12 ", 530, 160, 209, 21) nom de la zone de texte 12 GUICtrlSetState (-1, $ GUI_DISABLE) GUICtrlSetBkColor (-1, 0) GUICtrlSetState (-1, $ GUItrlSetColor (-1, 0x00ff00); couleur ;création des icones pour l'état des ping Global $Status1 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 60, 16, 16) ; insertion de l'icone statut 1 Global $Status2 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 85, 16, 16) ; insertion de l'icone statut 2 Global $Status3 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 110, 16, 16) ; insertion de l'icone statut 3 Global $Status4 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 135, 16, 16) ; insertion de l'icone statut 4 Global $Status5 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 160, 16, 16) ; insertion de l'icone statut 5 Global $Status6 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 185, 16, 16) ; insertion de l'icone statut 6 Global $Status7 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 210, 16, 16) ; insertion de l'icone statut 7 ; création des icônes de l'état des services Global $ Status8 = GUICtrlCreateIcon (@ScriptDir & "\ Yellow.ico", -1, 740, 60, 16, 16); insertion de l'état statut 8 Global $ Status9 = GUICtrlCreateIcon (@ScriptDir & "\ Yellow.ico", -1, 740, 85, 16, 16); insertion de statut 9 Global $ Status10 = GUICtrlCreateIcon (@ScriptDir & "\ Yellow.ico", -1, 740, 110, 16, 16); insertion de statut 10 Global $ Status11 = GUICtrlCreateIcon (@ScriptDir & "\ Yellow.ico", -1, 740, 135, 16, 16); insertion de statut 11 Global $ Status12 = GUICtrlCreateIcon (@ScriptDir & "\ Yellow.ico", -1, 740, 160, 16, 16); insertion de l'icone statut 12 GUISetState (@SW_SHOW) ; création des menus $ MenuFichier = GUICtrlCreateMenu ("& Fichier") $ MenuRedemarrer = GUICtrlCreateMenuItem ("Redémarrer" & "Ctrl + F4", " MenuFichier"), est un élément de base. Quitter "& @ TAB &" Ctrl + Q ", $ MenuFichier) $ MenuOutils = GUICtrlCreateMenu (" & Outils ") $ MenuCmd = GUICtrlCreateMenuItem (" CMD ", $ MenuOutils) $ MenuTire1 = GUICtrlCreateMenuImment ("Client Telnet", $ MenuOutils) $ MenuTire2 = GUICtrlCreateMenuItem ("", $ MenuOutils) $ MenuBlocnote = GUICtrlCreateMenuItem ("Bloc note",$ MenuOutils) $ MenuTire3 = GUICtrlCreateMenuItem ("", $ MenuOutils) $ MenuCalc = GUICtrlCreateMenuItem ( "Calculatrice", MenuOutils $) $ Menur = GUICtrlCreateMenu ( "& Réseaux") $ MenuSt001 = GUICtrlCreateMenuItem ( "ST0-1", Menur $) $ MenuTire5 = GUICtrlCreateMenuItem ( "", Menur $) $ = MenuSt002 GUICtrlCreateMenuItem ( "ST0-2", Menur $) $ MenuTire6 = GUICtrlCreateMenuItem ( "", Menur $) $ MenuSt101 = GUICtrlCreateMenuItem ( "ST0-3", Menur $) $ MenuTire = GUICtrlCreateMenuItem ( "", Menur $) $ = MenuSt102 GUICtrlCreateMenuItem ("ST1-3", $ MenuR) $ MenuTire7 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuSt301 = GUICtrlCreateMenuItem ("ST2-1", $ MenuR) $ MenuTire8 = GUICtrlCreateMenuItem ("", "$ MenuR) $ MenuSt302 = GUICtrlCreateMenuItem ("ST2-2", $ MenuR) $ MenuItir9 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuItem4 = GUICtrlCreateMenuItem ("ST2-3", $ MenuR) $ MenuItem3 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuItem2 $ MenuItem7 = GUICtrlCreateMenuItem ( "", Menur $) $ MenuItem6 = GUICtrlCreateMenuItem ( "DR", Menur $) $ MenuItem5 = GUICtrlCreateMenuItem ( "", Menur $) $ MenuItem1 = GUICtrlCreateMenuItem ( "FRET", Menur $) $ MenuItem12 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuItem11 = GUICtrlCreateMenuItem ("VIP-DEPART", $ MenuR) $ MenuItem9 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuItem10 = GUICtrlCreateMenuItem ("VIP-ARRIVEE",$ MenuR) $ MenuItem8 = GUICtrlCreateMenuItem ("", $ MenuR) $ MenuItem13 = GUICtrlCreateMenuItem ("LTE", $ MenuR) $ StatusBar1 = _GUICtrlStatusBar_Create ($ Form1) Dim $ StatusBar1_PartsWidth [2] = [50, -1]; la barre de création de štatút _GUICtrlStatusBar_SetParts ($ StatusBar1, StatusBar1_PartsWidth $) _GUICtrlStatusBar_SetText ($ StatusBar1, "V1.0", 0) _GUICtrlStatusBar_SetText ($ StatusBar1, "Diagnostic systême ", 1) _GUICtrlStatusBar_SetMinHeight (StatusBar1 $, 35) $ ToolBar1 = _GUICtrlToolbar_Create ($ Form1, 0) $ Group1 = GUICtrlCreateGroup ("Etat des Ping", 16, 40, 393, 369) GUICtrlSetFont (-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup ("", -99, -99, 1, 1) $ Group2 = GUICtrlCreateGroup ("Etat des services", 424, 40, GUICtrlSetFont (-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup ("", -99, -99, 1, 1) $ Group3 = GUICtrlCreateGroup ("Options", 16, 424, 249, 145) GUICtrlSetFont (-1, 10, 800, 0, "MS Sans Serif") $ Button2 = GUICtrlCreateButton ("Envoyer", 136, 456, 107, 41, bitOR ($ BS_DEFPUSHBUTTON, $ WS_BORDER)) GUICtrlSetFont (-1, 8, 800 , 0, "MS Sans Serif") $ Button3 = GUICtrlCreateButton ("Redémarrer", 24, 512, 107, 41, bitOR ($ BS_DEFPUSHBUTTON, $ WS_BORDER)) GUICtrlSetFont (-1, 8, 800, 0, "MS Sans Serif ") $ Button4 = GUICtrlCreateButton (" Quitter ", 136, 512, 107, 41, BitOR ($ BS_DEFPUSHBUTTON, $ WS_BORDER)) GUICtrlSetFont (-1, 8, 800, 0," MS Sans Serif ") GUICtrlCreateGroup ("", -99, -99, 1, 1) ; GUICtrlCreateGroup ("", -99, -99, 1, 1) $ Button1 = GUICtrlCreateButton ("Rapport", 24, 456, 107, 41, BitOR ($ BS_DEFPUSHBUTTON, $ WS_BORDER)) GUICtrlSetFont (-1, 8, 800, 0, "MS Sans Serif") Dim $ Form1_AccelTable [2] [ 2] = [["^ {F4}", $ MenuRedemarrer], ["^ q", $ MenuQuitter]] GUISetAccelerators ($ Form1_AccelTable) ; $ Button1 = GUICtrlCreateButton ("Mirroring / principal", 8, 104, 147, 57, BitOR ($ BS_DEFPUSHBUTTON, $ BS_CENTER, $ WS_BORDER)) ; GUICtrlSetFont (-1, 10, 800, 0, "Verdana") ; $ Button2 = GUICtrlCreateButton ("Neurotechnology", 168, 104, 147, 57, BitOR ($ BS_DEFPUSHBUTTON, $ BS_CENTER, $ WS_BORDER)) ; GUICtrlSetFont (-1, 10, 800, 0, "Verdana") GUISetState (@SW_SHOW) AdlibRegister ("CheckStats", 9000); vérifier toutes les 10 secondes CheckStats () Pendant le sommeil (100) WEnd Func CheckStats () $ sURL = GUICtrlRead ($ Hostname1) $ sURL2 = GUICtrlRead ($ Hostname2) $ sURL3 = GUICtrlRead ($ Hostname3) $ sURL4 = GUICtrlRead ($ Hostname4) $ sURL5 = GUICtrlRead ($ Hostname5) $ sURL6 = GUICtrlRead ($ nom_hôte7) $ sURL8 = GUICtrlRead ($ nom_hôte8) $ sURL9 = GUICtrlRead ($ nom_hôte9) $ sURL10 = GUICtrlRead ( $ nom_hôte10 ) $ sURL11 = GUICtrlRead ( $ nom_hôte9 ) $ sURL10 = $ sURL12 = $ nom_hôte ; test de condition si vous avez des pertes de paquets Si Ping ($ sURL, 999)> 0 Alors GUICtrlSetImage ($ Status1, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname1, 0x00ff00 ) Sinon GUICtrlSetImage ($ Status1, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname1, 0xff0000) EndIf Si Ping ($ sURL2, 999)> 0, alors GUICtrlSetImage ($ Status2, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ NomHôte2, 0x00ff00) Sinon GUICtrlSetImage ($ Status2, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname2, 0xff0000) EndIf Si Ping ($ sURL3, 999)> 0, alors GUICtrlSetImage ($ Status3, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ NomHôte3, 0x00ff00) Sinon GUICtrlSetImage ($ Status3, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname3, 0xff0000) EndIf Si Ping ($ sURL4, 999)> 0, puis GUICtrlSetImage ($ Status4, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ NomHôte4, 0x00ff00) Sinon GUICtrlSetImage ($ Status4, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname4, 0xff0000) EndIf Si Ping ($ sURL5, 999)> 0, alors GUICtrlSetImage ($ Status5, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ NomHôte5, 0x00ff00) Sinon GUICtrlSetImage ($ Status5, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname5, 0xff0000) EndIf Si Ping ($ sURL6, 999)> 0, alors GUICtrlSetImage ($ Status6, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname6, 0x00ff00) Sinon GUICtrlSetImage ($ Status6, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname6, 0xff0000) EndIf Si Ping ($ sURL7, 999)> 0, alors GUICtrlSetImage ($ Status7, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname7, 0x00ff00) Sinon GUICtrlSetImage ($ Status7, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname7, 0xff0000) EndIf Si Ping ($ sURL8, 999)> 0, alors GUICtrlSetImage ($ Status8, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname8, 0x00ff00) Sinon GUICtrlSetImage ($ Status8, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname8, 0xff0000) EndIf Si Ping ($ sURL8, 999)> 0, alors GUICtrlSetImage ($ Status9, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname9, 0x00ff00) Sinon GUICtrlSetImage ($ Status9, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname9, 0xff0000) EndIf Si Ping ($ sURL10, 999)> 0, puis GUICtrlSetImage ($ Status10, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname10, 0x00ff00) Sinon GUICtrlSetImage ($ Status10, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname10, 0xff0000) EndIf Si Ping ($ sURL11, 999)> 0, alors GUICtrlSetImage ($ Status11, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname11, 0x00ff00) Sinon GUICtrlSetImage ($ Status11, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname11, 0xff0000) EndIf Si Ping ($ sURL12, 999)> 0, alors GUICtrlSetImage ($ Status12, @ScriptDir & "\ Green.ico") GUICtrlSetColor ($ Hostname12, 0x00ff00) Sinon GUICtrlSetImage ($ Status12, @ScriptDir & "\ Red.ico") GUICtrlSetColor ($ Hostname12, 0xff0000) EndIf Revenir EndFunc Func _hkExitApp () Exit ; c’est cette partie qui me pose problème While 1 $ nMsg = GUIGetMsg () Commutateur $ nMsg Cas $ GUI_EVENT_CLOSE Quitter Cas $ Button4 Quitter EndSwitch WEnd EndFunc; ==> _ hkExitApp Edited June 2, 2019 by Jos Added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 I guess you didn't understand this post at the time: ? So let me try once more: This is an English forum, not french, so do not post any other language than English! Post something small to demonstrate the issue. Use codetags to post the code The posted code gets a shitload of errors when ran through au3check, so this is not a valid Autoit3 script. Please check your code with au3check to ensure it is without any errors and come back when it is clean. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 (edited) 1 hour ago, Jos said: Je suppose que vous n'avez pas compris ce post à l'époque:? Alors laissez-moi essayer encore une fois: Ceci est un forum anglais, pas français, alors ne postez pas d'autre langue que l'anglais! Publiez quelque chose de petit pour démontrer le problème. Utilisez les étiquettes de code pour poster le code Le code posté reçoit un tas d'erreurs lorsqu'il est exécuté au3check, ce n'est donc pas un script Autoit3 valide. Veuillez vérifier votre code avec au3check pour vous assurer qu'il est exempt d'erreurs et revenir quand il est propre. Jos I see because I have three icons and this must be in the same folder as the script otherwise the script runs well at home it's a script that ping my address and shows green if the ping passes and red if the ping do not pass. revoila the code that runs. expandcollapse popup#NoTrayIcon ; bibliothèque pour les icones #include<GuiConstantsEx.au3> ; biblithèque constant #include <ButtonConstants.au3> ; bibliothèque pour les bouton #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; bibliothèque constant windows #include <GuiStatusBar.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> HotKeySet("{ESC}", "_hkExitApp") ; exit app Opt("GUIOnEventMode", 1); utiliser en mode événement Global $sURL ; Global url 1 Global $sURL2 ; Global url 2 Global $sURL3 ; Global url 3 Global $sURL4 ; Global url 4 Global $sURL5 ; Global url 5 Global $sURL6 ; Global url 6 Global $sURL7 ; Global url 7 Global $sURL8 ; Global url 8 Global $sURL9 ; Global url 9 Global $sURL10 ; Global url 10 Global $sURL11 ; Global url 11 Global $sURL12 ; Global url 12 $Form1 = GUICreate("App: Diagnostic Sysème V1.0", 832, 629, -1, -1) ; formulaire global GUISetOnEvent($GUI_EVENT_CLOSE, "_hkExitApp"); définir un événement de sortie et utiliser un constant pour qu'il n'est pas beaucoup de chiffres magiques GUISetBkColor(0xABABAB) ;création des labels pour l'états des ping GUICtrlCreateLabel("hote 1 :", 20, 60, 90, 17) ; label host 1 GUICtrlCreateLabel("hote 2 :", 20, 85, 90, 17) ; label host 2 GUICtrlCreateLabel("hote 3 :", 20, 110, 90, 17) ; label host 3 GUICtrlCreateLabel("hote 4 :", 20, 135, 90, 17) ; label host 4 GUICtrlCreateLabel("hote 5 :", 20, 160, 90, 17) ; label host 5 GUICtrlCreateLabel("hote 6 :", 20, 185, 90, 17) ; label host 6 GUICtrlCreateLabel("hote 7 :", 20, 210, 90, 17) ; label host 7 ;création des labels pour l'état des services GUICtrlCreateLabel("hote 8 :", 428, 60, 90, 17) ; label host 8 GUICtrlCreateLabel("hote 9 :", 428, 85, 90, 17) ; label host 9 GUICtrlCreateLabel("hote 10 :", 428, 110, 90, 17) ; label host 10 GUICtrlCreateLabel("hote 11 :", 428, 135, 90, 17) ; label host 11 GUICtrlCreateLabel("hote 12 :", 428, 160, 90, 17) ; label host 12 ;création des zones de texte pour l'états des ping Global $Hostname1 = GUICtrlCreateInput("10.10.7.1", 120, 60, 209, 21) ; zone de texte hostname 1 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname2 = GUICtrlCreateInput("10.10.7.2", 120, 85, 209, 21) ; zone de texte hostname 2 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname3 = GUICtrlCreateInput("10.10.7.3", 120, 110, 209, 21) ; zone de texte hostname 3 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname4 = GUICtrlCreateInput("10.10.7.4", 120, 135, 209, 21) ; zone de texte hostname 4 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname5 = GUICtrlCreateInput("10.10.7.5", 120, 160, 209, 21) ; zone de texte hostname 5 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname6 = GUICtrlCreateInput("10.10.7.6", 120, 185, 209, 21) ; zone de texte hostname 6 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname7 = GUICtrlCreateInput("10.10.7.7", 120, 210, 209, 21) ; zone de texte hostname 7 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur ;création des zones de texte pour l'états de services Global $Hostname8 = GUICtrlCreateInput("10.10.7.8", 530, 60, 209, 21) ; zone de texte hostname 8 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname9 = GUICtrlCreateInput("10.10.7.9", 530, 85, 209, 21) ; zone de texte hostname 9 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname10 = GUICtrlCreateInput("10.10.7.10", 530, 110, 209, 21) ; zone de texte hostname 10 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname11 = GUICtrlCreateInput("10.10.7.11", 530, 135, 209, 21) ; zone de texte hostname 11 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname12 = GUICtrlCreateInput("10.10.7.12", 530, 160, 209, 21) ; zone de texte hostname 12 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur ;création des icones pour l'état des ping Global $Status1 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 60, 16, 16) ; insertion de l'icone statut 1 Global $Status2 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 85, 16, 16) ; insertion de l'icone statut 2 Global $Status3 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 110, 16, 16) ; insertion de l'icone statut 3 Global $Status4 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 135, 16, 16) ; insertion de l'icone statut 4 Global $Status5 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 160, 16, 16) ; insertion de l'icone statut 5 Global $Status6 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 185, 16, 16) ; insertion de l'icone statut 6 Global $Status7 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 210, 16, 16) ; insertion de l'icone statut 7 ;création des icones pour l'état des services Global $Status8 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 60, 16, 16) ; insertion de l'icone statut 8 Global $Status9 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 85, 16, 16) ; insertion de l'icone statut 9 Global $Status10 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 110, 16, 16) ; insertion de l'icone statut 10 Global $Status11 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 135, 16, 16) ; insertion de l'icone statut 11 Global $Status12 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 160, 16, 16) ; insertion de l'icone statut 12 GUISetState(@SW_SHOW) ;création des menus $MenuFichier = GUICtrlCreateMenu("&Fichier") $MenuRedemarrer = GUICtrlCreateMenuItem("Redémarrer"&@TAB&"Ctrl+F4", $MenuFichier) $MenuTirer4 = GUICtrlCreateMenuItem("", $MenuFichier) $MenuQuitter = GUICtrlCreateMenuItem("Quitter"&@TAB&"Ctrl+Q", $MenuFichier) $MenuOutils = GUICtrlCreateMenu("&Outils") $MenuCmd = GUICtrlCreateMenuItem("CMD", $MenuOutils) $MenuTire1 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuTelnet = GUICtrlCreateMenuItem("Client Telnet", $MenuOutils) $MenuTire2 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuBlocnote = GUICtrlCreateMenuItem("Bloc note", $MenuOutils) $MenuTire3 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuCalc = GUICtrlCreateMenuItem("Calculatrice", $MenuOutils) $MenuR = GUICtrlCreateMenu("&Réseaux") $MenuSt001 = GUICtrlCreateMenuItem("ST0-1", $MenuR) $MenuTire5 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt002 = GUICtrlCreateMenuItem("ST0-2", $MenuR) $MenuTire6 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt101 = GUICtrlCreateMenuItem("ST0-3", $MenuR) $MenuTire = GUICtrlCreateMenuItem("", $MenuR) $MenuSt102 = GUICtrlCreateMenuItem("ST1-3", $MenuR) $MenuTire7 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt301 = GUICtrlCreateMenuItem("ST2-1", $MenuR) $MenuTire8 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt302 = GUICtrlCreateMenuItem("ST2-2", $MenuR) $MenuItir9 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem4 = GUICtrlCreateMenuItem("ST2-3", $MenuR) $MenuItem3 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem2 = GUICtrlCreateMenuItem("ST2-4", $MenuR) $MenuItem7 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem6 = GUICtrlCreateMenuItem("DR", $MenuR) $MenuItem5 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem1 = GUICtrlCreateMenuItem("FRET", $MenuR) $MenuItem12 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem11 = GUICtrlCreateMenuItem("VIP-DEPART", $MenuR) $MenuItem9 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem10 = GUICtrlCreateMenuItem("VIP-ARRIVEE", $MenuR) $MenuItem8 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem13 = GUICtrlCreateMenuItem("LTE", $MenuR) $StatusBar1 = _GUICtrlStatusBar_Create($Form1) Dim $StatusBar1_PartsWidth[2] = [50, -1] ; création de la barre de statut _GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth) _GUICtrlStatusBar_SetText($StatusBar1, "V1.0", 0) _GUICtrlStatusBar_SetText($StatusBar1, "Diagnostic Système", 1) _GUICtrlStatusBar_SetMinHeight($StatusBar1, 35) $ToolBar1 = _GUICtrlToolbar_Create($Form1, 0) $Group1 = GUICtrlCreateGroup("Etat des Ping", 16, 40, 393, 369) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Etat des services", 424, 40, 393, 369) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Options", 16, 424, 249, 145) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Envoyer", 136, 456, 107, 41, BitOR($BS_DEFPUSHBUTTON,$WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Redémarrer", 24, 512, 107, 41, BitOR($BS_DEFPUSHBUTTON,$WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button4 = GUICtrlCreateButton("Quitter", 136, 512, 107, 41, BitOR($BS_DEFPUSHBUTTON,$WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Rapport", 24, 456, 107, 41, BitOR($BS_DEFPUSHBUTTON,$WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Dim $Form1_AccelTable[2][2] = [["^{F4}", $MenuRedemarrer],["^q", $MenuQuitter]] GUISetAccelerators($Form1_AccelTable) ;$Button1 = GUICtrlCreateButton("Mirroring/principal", 8, 104, 147, 57, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER,$WS_BORDER)) ;GUICtrlSetFont(-1, 10, 800, 0, "Verdana") ;$Button2 = GUICtrlCreateButton("Neurotechnology", 168, 104, 147, 57, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER,$WS_BORDER)) ;GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUISetState(@SW_SHOW) AdlibRegister("CheckStats", 9000); vérifiez-les toutes les 10 secondes CheckStats() While Sleep(100) WEnd Func CheckStats() $sURL = GUICtrlRead($Hostname1) $sURL2 = GUICtrlRead($Hostname2) $sURL3 = GUICtrlRead($Hostname3) $sURL4 = GUICtrlRead($Hostname4) $sURL5 = GUICtrlRead($Hostname5) $sURL6 = GUICtrlRead($Hostname6) $sURL7 = GUICtrlRead($Hostname7) $sURL8 = GUICtrlRead($Hostname8) $sURL9 = GUICtrlRead($Hostname9) $sURL10 = GUICtrlRead($Hostname10) $sURL11 = GUICtrlRead($Hostname11) $sURL12 = GUICtrlRead($Hostname12) ;test de condition si ping reuissi ou pas oubien s'il y a des pertes de paquets If Ping($sURL, 999) > 0 Then GUICtrlSetImage($Status1, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname1, 0x00ff00) Else GUICtrlSetImage($Status1, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname1, 0xff0000) EndIf If Ping($sURL2, 999) > 0 Then GUICtrlSetImage($Status2, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname2, 0x00ff00) Else GUICtrlSetImage($Status2, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname2, 0xff0000) EndIf If Ping($sURL3, 999) > 0 Then GUICtrlSetImage($Status3, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname3, 0x00ff00) Else GUICtrlSetImage($Status3, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname3, 0xff0000) EndIf If Ping($sURL4, 999) > 0 Then GUICtrlSetImage($Status4, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname4, 0x00ff00) Else GUICtrlSetImage($Status4, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname4, 0xff0000) EndIf If Ping($sURL5, 999) > 0 Then GUICtrlSetImage($Status5, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname5, 0x00ff00) Else GUICtrlSetImage($Status5, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname5, 0xff0000) EndIf If Ping($sURL6, 999) > 0 Then GUICtrlSetImage($Status6, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname6, 0x00ff00) Else GUICtrlSetImage($Status6, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname6, 0xff0000) EndIf If Ping($sURL7, 999) > 0 Then GUICtrlSetImage($Status7, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname7, 0x00ff00) Else GUICtrlSetImage($Status7, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname7, 0xff0000) EndIf If Ping($sURL8, 999) > 0 Then GUICtrlSetImage($Status8, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname8, 0x00ff00) Else GUICtrlSetImage($Status8, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname8, 0xff0000) EndIf If Ping($sURL8, 999) > 0 Then GUICtrlSetImage($Status9, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname9, 0x00ff00) Else GUICtrlSetImage($Status9, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname9, 0xff0000) EndIf If Ping($sURL10, 999) > 0 Then GUICtrlSetImage($Status10, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname10, 0x00ff00) Else GUICtrlSetImage($Status10, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname10, 0xff0000) EndIf If Ping($sURL11, 999) > 0 Then GUICtrlSetImage($Status11, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname11, 0x00ff00) Else GUICtrlSetImage($Status11, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname11, 0xff0000) EndIf If Ping($sURL12, 999) > 0 Then GUICtrlSetImage($Status12, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname12, 0x00ff00) Else GUICtrlSetImage($Status12, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname12, 0xff0000) EndIf Return EndFunc Func _hkExitApp() Exit ;it is this part that poses me problem While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button4 Exit EndSwitch WEnd EndFunc ;==>_hkExitApp green.ico red.ico yellow.ico Edited June 2, 2019 by Jos added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 1 hour ago, Jos said: So let me try once more: This is an English forum, not french, so do not post any other language than English! Post something small to demonstrate the issue. Use codetags to post the code Did you read this, translate and understand this at all, because you again simply ignored it? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 3 minutes ago, Jos said: L'avez-vous lu, traduit et compris, parce que vous l'avez simplement ignoré? Jos Oh! sorry I understood this is even better. a.au3 Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 (edited) 2 minutes ago, SANOGO said: Oh! sorry I understood this is even better. Not really as you are posting again some French text! Stop that please! You are mixing eventmode and normal mode for the GUI. Have a look at this version and see if you understand: tehre are still some debug lines in so you can see what is happening. expandcollapse popup#NoTrayIcon ; bibliothèque pour les icones #include <GuiConstantsEx.au3>; biblithèque constant #include <ButtonConstants.au3>; bibliothèque pour les bouton #include <GUIConstantsEx.au3> #include <WindowsConstants.au3>; bibliothèque constant windows #include <GuiStatusBar.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> HotKeySet("{ESC}", "_hkExitApp") ; exit app ;Opt("GUIOnEventMode", 1) ; utiliser en mode événement Global $sURL ; Global url 1 Global $sURL2 ; Global url 2 Global $sURL3 ; Global url 3 Global $sURL4 ; Global url 4 Global $sURL5 ; Global url 5 Global $sURL6 ; Global url 6 Global $sURL7 ; Global url 7 Global $sURL8 ; Global url 8 Global $sURL9 ; Global url 9 Global $sURL10 ; Global url 10 Global $sURL11 ; Global url 11 Global $sURL12 ; Global url 12 $Form1 = GUICreate("App: Diagnostic Sysème V1.0", 832, 629, -1, -1) ; formulaire global GUISetOnEvent($GUI_EVENT_CLOSE, "_hkExitApp") ; définir un événement de sortie et utiliser un constant pour qu'il n'est pas beaucoup de chiffres magiques GUISetBkColor(0xABABAB) ;création des labels pour l'états des ping GUICtrlCreateLabel("hote 1 :", 20, 60, 90, 17) ; label host 1 GUICtrlCreateLabel("hote 2 :", 20, 85, 90, 17) ; label host 2 GUICtrlCreateLabel("hote 3 :", 20, 110, 90, 17) ; label host 3 GUICtrlCreateLabel("hote 4 :", 20, 135, 90, 17) ; label host 4 GUICtrlCreateLabel("hote 5 :", 20, 160, 90, 17) ; label host 5 GUICtrlCreateLabel("hote 6 :", 20, 185, 90, 17) ; label host 6 GUICtrlCreateLabel("hote 7 :", 20, 210, 90, 17) ; label host 7 ;création des labels pour l'état des services GUICtrlCreateLabel("hote 8 :", 428, 60, 90, 17) ; label host 8 GUICtrlCreateLabel("hote 9 :", 428, 85, 90, 17) ; label host 9 GUICtrlCreateLabel("hote 10 :", 428, 110, 90, 17) ; label host 10 GUICtrlCreateLabel("hote 11 :", 428, 135, 90, 17) ; label host 11 GUICtrlCreateLabel("hote 12 :", 428, 160, 90, 17) ; label host 12 ;création des zones de texte pour l'états des ping Global $Hostname1 = GUICtrlCreateInput("10.10.7.1", 120, 60, 209, 21) ; zone de texte hostname 1 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname2 = GUICtrlCreateInput("10.10.7.2", 120, 85, 209, 21) ; zone de texte hostname 2 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname3 = GUICtrlCreateInput("10.10.7.3", 120, 110, 209, 21) ; zone de texte hostname 3 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname4 = GUICtrlCreateInput("10.10.7.4", 120, 135, 209, 21) ; zone de texte hostname 4 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname5 = GUICtrlCreateInput("10.10.7.5", 120, 160, 209, 21) ; zone de texte hostname 5 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname6 = GUICtrlCreateInput("10.10.7.6", 120, 185, 209, 21) ; zone de texte hostname 6 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname7 = GUICtrlCreateInput("10.10.7.7", 120, 210, 209, 21) ; zone de texte hostname 7 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur ;création des zones de texte pour l'états de services Global $Hostname8 = GUICtrlCreateInput("10.10.7.8", 530, 60, 209, 21) ; zone de texte hostname 8 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname9 = GUICtrlCreateInput("10.10.7.9", 530, 85, 209, 21) ; zone de texte hostname 9 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname10 = GUICtrlCreateInput("10.10.7.10", 530, 110, 209, 21) ; zone de texte hostname 10 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname11 = GUICtrlCreateInput("10.10.7.11", 530, 135, 209, 21) ; zone de texte hostname 11 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur Global $Hostname12 = GUICtrlCreateInput("10.10.7.12", 530, 160, 209, 21) ; zone de texte hostname 12 GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1, 0x00ff00) ; couleur ;création des icones pour l'état des ping Global $Status1 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 60, 16, 16) ; insertion de l'icone statut 1 Global $Status2 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 85, 16, 16) ; insertion de l'icone statut 2 Global $Status3 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 110, 16, 16) ; insertion de l'icone statut 3 Global $Status4 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 135, 16, 16) ; insertion de l'icone statut 4 Global $Status5 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 160, 16, 16) ; insertion de l'icone statut 5 Global $Status6 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 185, 16, 16) ; insertion de l'icone statut 6 Global $Status7 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 330, 210, 16, 16) ; insertion de l'icone statut 7 ;création des icones pour l'état des services Global $Status8 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 60, 16, 16) ; insertion de l'icone statut 8 Global $Status9 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 85, 16, 16) ; insertion de l'icone statut 9 Global $Status10 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 110, 16, 16) ; insertion de l'icone statut 10 Global $Status11 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 135, 16, 16) ; insertion de l'icone statut 11 Global $Status12 = GUICtrlCreateIcon(@ScriptDir & "\Yellow.ico", -1, 740, 160, 16, 16) ; insertion de l'icone statut 12 GUISetState(@SW_SHOW) ;création des menus $MenuFichier = GUICtrlCreateMenu("&Fichier") $MenuRedemarrer = GUICtrlCreateMenuItem("Redémarrer" & @TAB & "Ctrl+F4", $MenuFichier) $MenuTirer4 = GUICtrlCreateMenuItem("", $MenuFichier) $MenuQuitter = GUICtrlCreateMenuItem("Quitter" & @TAB & "Ctrl+Q", $MenuFichier) $MenuOutils = GUICtrlCreateMenu("&Outils") $MenuCmd = GUICtrlCreateMenuItem("CMD", $MenuOutils) $MenuTire1 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuTelnet = GUICtrlCreateMenuItem("Client Telnet", $MenuOutils) $MenuTire2 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuBlocnote = GUICtrlCreateMenuItem("Bloc note", $MenuOutils) $MenuTire3 = GUICtrlCreateMenuItem("", $MenuOutils) $MenuCalc = GUICtrlCreateMenuItem("Calculatrice", $MenuOutils) $MenuR = GUICtrlCreateMenu("&Réseaux") $MenuSt001 = GUICtrlCreateMenuItem("ST0-1", $MenuR) $MenuTire5 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt002 = GUICtrlCreateMenuItem("ST0-2", $MenuR) $MenuTire6 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt101 = GUICtrlCreateMenuItem("ST0-3", $MenuR) $MenuTire = GUICtrlCreateMenuItem("", $MenuR) $MenuSt102 = GUICtrlCreateMenuItem("ST1-3", $MenuR) $MenuTire7 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt301 = GUICtrlCreateMenuItem("ST2-1", $MenuR) $MenuTire8 = GUICtrlCreateMenuItem("", $MenuR) $MenuSt302 = GUICtrlCreateMenuItem("ST2-2", $MenuR) $MenuItir9 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem4 = GUICtrlCreateMenuItem("ST2-3", $MenuR) $MenuItem3 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem2 = GUICtrlCreateMenuItem("ST2-4", $MenuR) $MenuItem7 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem6 = GUICtrlCreateMenuItem("DR", $MenuR) $MenuItem5 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem1 = GUICtrlCreateMenuItem("FRET", $MenuR) $MenuItem12 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem11 = GUICtrlCreateMenuItem("VIP-DEPART", $MenuR) $MenuItem9 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem10 = GUICtrlCreateMenuItem("VIP-ARRIVEE", $MenuR) $MenuItem8 = GUICtrlCreateMenuItem("", $MenuR) $MenuItem13 = GUICtrlCreateMenuItem("LTE", $MenuR) $StatusBar1 = _GUICtrlStatusBar_Create($Form1) Dim $StatusBar1_PartsWidth[2] = [50, -1] ; création de la barre de statut _GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth) _GUICtrlStatusBar_SetText($StatusBar1, "V1.0", 0) _GUICtrlStatusBar_SetText($StatusBar1, "Diagnostic Système", 1) _GUICtrlStatusBar_SetMinHeight($StatusBar1, 35) $ToolBar1 = _GUICtrlToolbar_Create($Form1, 0) $Group1 = GUICtrlCreateGroup("Etat des Ping", 16, 40, 393, 369) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Etat des services", 424, 40, 393, 369) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Options", 16, 424, 249, 145) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Envoyer", 136, 456, 107, 41, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Redémarrer", 24, 512, 107, 41, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button4 = GUICtrlCreateButton("Quitter", 136, 512, 107, 41, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER)) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Button4 = ' & $Button4 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Rapport", 24, 456, 107, 41, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER)) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Dim $Form1_AccelTable[2][2] = [["^{F4}", $MenuRedemarrer], ["^q", $MenuQuitter]] GUISetAccelerators($Form1_AccelTable) ;$Button1 = GUICtrlCreateButton("Mirroring/principal", 8, 104, 147, 57, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER,$WS_BORDER)) ;GUICtrlSetFont(-1, 10, 800, 0, "Verdana") ;$Button2 = GUICtrlCreateButton("Neurotechnology", 168, 104, 147, 57, BitOR($BS_DEFPUSHBUTTON,$BS_CENTER,$WS_BORDER)) ;GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUISetState(@SW_SHOW) AdlibRegister("CheckStats", 9000) ; vérifiez-les toutes les 10 secondes :) CheckStats() While 1 While 1 $nMsg = GUIGetMsg() if $nMsg <> 0 then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $nMsg = ' & $nMsg & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Switch $nMsg Case $GUI_EVENT_CLOSE ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $GUI_EVENT_CLOSE = ' & $GUI_EVENT_CLOSE & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Exit Case $Button4 ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Button4 = ' & $Button4 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Exit EndSwitch WEnd WEnd Func CheckStats() $sURL = GUICtrlRead($Hostname1) $sURL2 = GUICtrlRead($Hostname2) $sURL3 = GUICtrlRead($Hostname3) $sURL4 = GUICtrlRead($Hostname4) $sURL5 = GUICtrlRead($Hostname5) $sURL6 = GUICtrlRead($Hostname6) $sURL7 = GUICtrlRead($Hostname7) $sURL8 = GUICtrlRead($Hostname8) $sURL9 = GUICtrlRead($Hostname9) $sURL10 = GUICtrlRead($Hostname10) $sURL11 = GUICtrlRead($Hostname11) $sURL12 = GUICtrlRead($Hostname12) ;test de condition si ping reuissi ou pas oubien s'il y a des pertes de paquets If Ping($sURL, 999) > 0 Then GUICtrlSetImage($Status1, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname1, 0x00ff00) Else GUICtrlSetImage($Status1, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname1, 0xff0000) EndIf If Ping($sURL2, 999) > 0 Then GUICtrlSetImage($Status2, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname2, 0x00ff00) Else GUICtrlSetImage($Status2, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname2, 0xff0000) EndIf If Ping($sURL3, 999) > 0 Then GUICtrlSetImage($Status3, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname3, 0x00ff00) Else GUICtrlSetImage($Status3, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname3, 0xff0000) EndIf If Ping($sURL4, 999) > 0 Then GUICtrlSetImage($Status4, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname4, 0x00ff00) Else GUICtrlSetImage($Status4, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname4, 0xff0000) EndIf If Ping($sURL5, 999) > 0 Then GUICtrlSetImage($Status5, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname5, 0x00ff00) Else GUICtrlSetImage($Status5, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname5, 0xff0000) EndIf If Ping($sURL6, 999) > 0 Then GUICtrlSetImage($Status6, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname6, 0x00ff00) Else GUICtrlSetImage($Status6, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname6, 0xff0000) EndIf If Ping($sURL7, 999) > 0 Then GUICtrlSetImage($Status7, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname7, 0x00ff00) Else GUICtrlSetImage($Status7, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname7, 0xff0000) EndIf If Ping($sURL8, 999) > 0 Then GUICtrlSetImage($Status8, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname8, 0x00ff00) Else GUICtrlSetImage($Status8, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname8, 0xff0000) EndIf If Ping($sURL8, 999) > 0 Then GUICtrlSetImage($Status9, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname9, 0x00ff00) Else GUICtrlSetImage($Status9, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname9, 0xff0000) EndIf If Ping($sURL10, 999) > 0 Then GUICtrlSetImage($Status10, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname10, 0x00ff00) Else GUICtrlSetImage($Status10, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname10, 0xff0000) EndIf If Ping($sURL11, 999) > 0 Then GUICtrlSetImage($Status11, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname11, 0x00ff00) Else GUICtrlSetImage($Status11, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname11, 0xff0000) EndIf If Ping($sURL12, 999) > 0 Then GUICtrlSetImage($Status12, @ScriptDir & "\Green.ico") GUICtrlSetColor($Hostname12, 0x00ff00) Else GUICtrlSetImage($Status12, @ScriptDir & "\Red.ico") GUICtrlSetColor($Hostname12, 0xff0000) EndIf Return EndFunc ;==>CheckStats Func _hkExitApp() Exit ;it is this part that poses me problem EndFunc ;==>_hkExitApp Jos Edited June 2, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 10 minutes ago, Jos said: Vous mélangez eventmode et mode normal pour l'interface graphique. Regardez cette version et voyez si vous comprenez: il y a encore quelques lignes de débogage afin que vous puissiez voir ce qui se passe. expandcollapse popup#NoTrayIcon ; bibliothèque pour les icônes #include <GuiConstantsEx.au3> ; biblithèque constante #include <ButtonConstants.au3> ; bibliothèque pour le bouton #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; bibliothèque constante windows #include <GuiStatusBar.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> HotKeySet ( "{ESC}" , "_hkExitApp" ) ; quitter l'application ; Opt ("GUIOnEventMode", 1); utiliser en mode événement Global $ sURL ; URL globale 1 Global $ sURL2 ; URL globale 2 Global $ sURL3 ; URL globale 3 Global $ sURL4 ; URL globale 4 Global $ sURL5 ; URL globale 5 Global $ sURL6 ; URL globale 6 Global $ sURL7 ; URL globale 7 Global $ sURL8 ; URL globale 8 Global $ sURL9 ; URL globale 9 Global $ sURL10 ; URL globale 10 Global $ sURL11 ; URL globale 11 Global $ sURL12 ; URL globale 12 $ Form1 = GUICreate ( "App: Diagnostic Sysème V1.0" , 832 , 629 , - 1 , - 1 ) ; formulaire global GUISetOnEvent ( $ GUI_EVENT_CLOSE , "_hkExitApp" ) ; définir un événement de sortie et utiliser une constante pour qu'il n'est pas beaucoup de chiffres magiques GUISetBkColor ( 0xABABAB ) ; création des étiquettes pour l'étiquetage des commandes GUICtrlCreateLabel ( "hote 1:" , 20 , 60 , 90 , 17 ) ; label host 1 GUICtrlCreateLabel ( "hote 2:" , 20 , 85 , 90 , 17 ) ; label host 2 GUICtrlCreateLabel ( "hote 3:" , 20 , 110 , 90 , 17 ) ; label host 3 GUICtrlCreateLabel ( "hote 4:" , 20 , 135 , 90 , 17 ) ; label host 4 GUICtrlCreateLabel ( "hote 5:" , 20 , 160 , 90 , 17 ) ; label host 5 GUICtrlCreateLabel ( "hote 6:" , 20 , 185 , 90 , 17 ) ; label host 6 GUICtrlCreateLabel ( "hote 7:" , 20 , 210 , 90 , 17 ) ; label host 7 ; création des étiquettes pour l'état des services GUICtrlCreateLabel ( " texte 8:" , 428 , 60 , 90 , 17 ) ; label host 8 GUICtrlCreateLabel ( "hote 9:" , 428 , 85 , 90 , 17 ) ; label host 9 GUICtrlCreateLabel ( "hote 10:" , 428 , 110 , 90 , 17 ) ; label host 10 GUICtrlCreateLabel ( "hote 11:" , 428 , 135 , 90 , 17 ) ; label host 11 GUICtrlCreateLabel ( "hote 12:" , 428 , 160 , 90 , 17 ) ; label host 12 ; création de zones de texte pour l'états de ping Global $ Hostname1 = GUICtrlCreateInput ( "10.10.7.1" , 120 , 60 , 209 , 21 ) ; zone de texte nom d'hôte 1 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname2 = GUICtrlCreateInput ( "10.10.7.2" , 120 , 85 , 209 , 21 ) ; zone de texte nom d'hôte 2 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname3 = GUICtrlCreateInput ( "10.10.7.3" , 120 , 110 , 209 , 21 ) ; zone de texte nom d'hôte 3 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname4 = GUICtrlCreateInput ( "10.10.7.4" , 120 , 135 , 209 , 21 ) ; zone de texte nom d'hôte 4 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname5 = GUICtrlCreateInput ( "10.10.7.5" , 120 , 160 , 209 , 21 ) ; zone de texte nom d'hôte 5 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname6 = GUICtrlCreateInput ( "10.10.7.6" , 120 , 185 , 209 , 21 ) ; zone de texte nom d'hôte 6 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname7 = GUICtrlCreateInput ( "10.10.7.7" , 120 , 210 , 209 , 21 ) ; zone de texte nom d'hôte 7 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur ; création des zones de texte pour les services globaux $ $ Hostname8 = GUICtrlCreateInput ( "10.10.7.8" , 530 , 60 , 209 , 21 ) ; zone de texte nom d'hôte 8 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname9 = GUICtrlCreateInput ( "10.10.7.9" , 530 , 85 , 209 , 21 ) ; zone de texte nom d'hôte 9 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname10 = GUICtrlCreateInput ( "10.10.7.10" , 530 , 110 , 209 , 21 ) ; zone de texte nom d'hôte 10 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname11 = GUICtrlCreateInput ( "10.10.7.11" , 530 , 135 , 209 , 21 ) ; zone de texte nom d'hôte 11 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur Global $ Hostname12 = GUICtrlCreateInput ( "10.10.7.12" , 530 , 160 , 209 , 21 ) ; zone de texte nom d'hôte 12 GUICtrlSetState ( - 1 , $ GUI_DISABLE ) GUICtrlSetBkColor ( - 1 , 0 ) GUICtrlSetColor ( - 1 , 0x00ff00 ) ; couleur ; des icônes création L'État des répandrai ping global $ Status1 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 60 , 16 , 16 ) ; insertion de l'icone 1 statut global $ Status2 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 85 , 16 , 16 ) ; insertion de l'icone statut 2 Global $ Status3 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 110 , 16 , 16 ) ; insertion de l'icone 3 statut global $ STATUS4 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 135 , 16 , 16 ) ; insertion de l'état statut 4 Global $ Status5 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 160 , 16 , 16 ) ; insertion de l'icone 5 statut global $ Status6 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330 , 185 , 16 , 16 ) ; insertion de l'état statut 6 Global $ Status7 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 330, 210 , 16 , 16 ) ; insertion de l'icone statut 7 , des icônes création Pour L'état des services mondiaux $ Status8 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 740 , 60 , 16 , 16 ) ; insertion de l'état statut 8 Global $ Status9 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 740 , 85 , 16 , 16 ) ; insertion de l'icone statut 9 Global $ Status10 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 740 , 110 , 16 , 16 ) ; insertion de statut 10 Global $ Status11 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 740 , 135 , 16 , 16 ) ; insertion de l'état statut 11 Global $ Status12 = GUICtrlCreateIcon ( @ScriptDir & "\ Yellow.ico" , - 1 , 740 , 160 , 16 , 16 ) ; insertion de l'icone statut 12 GUISetState ( @SW_SHOW ) , la création des menus $ MenuFichier = GUICtrlCreateMenu ( "& Fichier" ) $ MenuRedemarrer = GUICtrlCreateMenuItem ( "Redémarrer" & @TAB et "Ctrl + F4" , MenuFichier $ ) $ MenuTirer4 = GUICtrlCreateMenuItem ( "" , MenuFichier $ ) $ MenuQuitter = GUICtrlCreateMenuItem ( "Quitter" & @TAB & "Ctrl + Q" , $ MenuFichier ) $ MenuOutils = GUICtrlCreateMenu ("& Tools" ) $ menucmd = GUICtrlCreateMenuItem ( "CMD" , $ MenuOutils ) $ MenuTire1 = GUICtrlCreateMenuItem ( "" , MenuOutils $ ) $ MenuTelnet = GUICtrlCreateMenuItem ( "Telnet client" , MenuOutils $ ) $ MenuTire2 = GUICtrlCreateMenuItem ( "" , $ MenuOutils ) $ MenuBlocnote = GUICtrlCreateMenuItem ( "Bloc note" , $ MenuOutils ) $ MenuTire3 = GUICtrlCreateMenuItem ( "" , MenuOutils $ ) $ MenuCalc = GUICtrlCreateMenuItem ( "Calculatrice" , MenuOutils $ ) $ Menur = GUICtrlCreateMenu ( "& Réseaux" ) $ MenuSt001 = GUICtrlCreateMenuItem ( "ST0-1" , Menur $ ) $ MenuTire5 = GUICtrlCreateMenuItem ( "" , $ MenuR ) $ MenuSt002 = GUICtrlCreateMenuItem ( "ST0-2" , $ MenuR ) $ MenuTire6 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuSt101 = GUICtrlCreateMenuItem ( "ST0-3" , Menur $ ) $ MenuTire = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuSt102 = GUICtrlCreateMenuItem ( "ST1-3" , Menur $ ) $ MenuTire7 = GUICtrlCreateMenuItem ( "" , $ MenuR ) $ MenuSt301 = GUICtrlCreateMenuItem ( "ST2-1", Menur $ ) $ MenuTire8 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuSt302 = GUICtrlCreateMenuItem ( "ST2-2" , Menur $ ) $ MenuItir9 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuItem4 = GUICtrlCreateMenuItem ( "ST2-3" , $ MenuR ) $ MenuItem3 = GUICtrlCreateMenuItem ( "" , $ MenuR ) $ MenuItem2 = GUICtrlCreateMenuItem ( "ST2-4" , Menur $ ) $ MenuItem7 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuItem6 = GUICtrlCreateMenuItem ( "DR" , Menur $ ) $ MenuItem5 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuItem1 = GUICtrlCreateMenuItem ( "FRET" , $ MenuR ) $ MenuItem12 = GUICtrlCreateMenuItem ( "" , $ MenuR ) $ MenuItem11 = GUICtrlCreateMenuItem ( "VIP-DEPART" , Menur $ ) $ MenuItem9 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuItem10 = GUICtrlCreateMenuItem ( "VIP-ARRIVEE" , Menur $ ) $ MenuItem8 = GUICtrlCreateMenuItem ( "" , Menur $ ) $ MenuItem13 = GUICtrlCreateMenuItem ( "LTE" , $ MenuR ) $ StatusBar1 = _GUICtrlStatusBar_Create ($ Form1 ) Dim $ StatusBar1_PartsWidth [ 2 ] = [ 50 , - 1 ] ; la barre de création de štatút _GUICtrlStatusBar_SetParts ( $ StatusBar1 , StatusBar1_PartsWidth $ ) _GUICtrlStatusBar_SetText ( StatusBar1 $ , "V1.0" , 0 ) _GUICtrlStatusBar_SetText ( $ StatusBar1 , "Diagnostic systême" , 1 ) _GUICtrlStatusBar_SetMinHeight ( StatusBar1 $ , 35 ) $ ToolBar1 = _GUICtrlToolbar_Create ( $ Form1 , 0 ) $ Group1 = GUICtrlCreateGroup ( "Etat des Ping" , 16 , 40 , 393 , 369 ) GUICtrlSetFont ( - 1 , 10 , 800 , 0 , "MS Sans Serif" ) GUICtrlCreateGroup ( "" , - 99 , - 99 , 1 , 1 ) $ Group2 = GUICtrlCreateGroup ( "Etat des services" , 424 , 40 , 393 , 369 ) GUICtrlSetFont ( - 1 , 10 , 800 , 0 , "MS Sans Serif" ) GUICtrlCreateGroup ( "" , - 99 , - 99 , - 99 , 1 , 1 ) $ Groupe3 = GUICtrlCreateGroup ( "Options" , 16 , 424 , 249 , 145) GUICtrlSetFont ( - 1 , 10 , 800 , 0 , "MS Sans Serif" ) $ Button2 = GUICtrlCreateButton ( "Envoyer" , 136 , 456 , 107 , 41 , bitOR ( $ BS_DEFPUSHBUTTON , $ WS_BORDER ) ) GUICtrlSetFont ( - 1 , 8 , 800 , 0 , "MS Sans Serif" ) $ Button3 = GUICtrlCreateButton ( "Redémarrer" , 24 , 512 , 107 , 41 , BitOR ( $ BS_DEFPUSHBUTTON , $ WS_BORDER ) ) GUICtrlSetFont ( - 1 , 8 , 800 , 0 , "MS Sans Serif" ) $ Button4 = GUICtrlCreateButton ( "Quitter" , 136) , 512 , 107 , 41 , bitOR ( $ BS_DEFPUSHBUTTON , $ WS_BORDER ) ) ConsoleWrite ( '@@ Debug (' & @ScriptLineNumber & '): $ Button4 =' & $ Button4 & @CRLF & '> Code d'erreur:' & @error & @CRLF ) ; ### GUICtrlSetFont de la console de débogage ( - 1 , 8 , 800 , 0 , "MS Sans Serif" ) GUICtrlCreateGroup ( "" , - 99 , - 99 , 1 , 1 ) ; GUICtrlCreateGroup ("", -99, -99, 1, 1) $ Button1 = GUICtrlCreateButton ( "Rapport" , 24 , 456 , 107 , 41 , bitOR ( $ BS_DEFPUSHBUTTON , $ WS_BORDER ) ) GUICtrlSetFont ( - 1 , 8 , 800 , 0 , "MS Sans Serif" ) Dim $ Form1_AccelTable [ 2 ] [ 2 ] = [ [ "^ {F4}" , $ MenuRedemarrer] , [ "^ q" , $ MenuQuitter ] ] GUISetAccelerators ( $ Form1_AccelTable ) ; $ Button1 = GUICtrlCreateButton ("Mirroring / principal", 8, 104, 147, 57, BitOR ($ BS_DEFPUSHBUTTON, $ BS_CENTER, $ WS_BORDER)) ; GUICtrlSetFont (-1, 10, 800, 0, "Verdana") ; $ Button2 = GUICtrlCreateButton ("Neurotechnology", 168, 104, 147, 57, BitOR ($ BS_DEFPUSHBUTTON, $ BS_CENTER, $ WS_BORDER)) ; GUICtrlSetFont (-1, 10, 800, 0, "Verdana") GUISetState ( @SW_SHOW ) AdlibRegister ( "CheckStats" , 9000 ) ; vérifiées toutes les 10 secondes :) CheckStats ( ) While 1 While 1 $ nMsg = GUIGetMsg ( ) si $ nMsg <> 0 puis ConsoleWrite ( '@@ Debug (' & @ScriptLineNumber & '): $ nMsg =' & $ nMsg & @CRLF & '> code d'erreur:' & @error & @CRLF ) ; ### Commutateur de console de débogage $ nMsg Case $ GUI_EVENT_CLOSE ConsoleWrite ( '@@ Debug (' & @ScriptLineNumber & '): $ GUI_EVENT_CLOSE =' & $ GUI_EVENT_CLOSE & @CRLF & '> Code d'erreur:' & @error & @CRLF ) ; ### Exit de la console de débogage Case $ Button4 ConsoleWrite ( '@@ Debug (' & @ScriptLineNumber & '): $ Button4 =' & $ Button4 & @CRLF & '> code d'erreur:' & @error & @CRLF ) ; ### Sortie de la console de débogage EndSwitch WEnd WEnd Func CheckStats ( ) $ sURL = GUICtrlRead ( $ hostname1 ) $ sURL2 = GUICtrlRead ( hostname2 $ ) $ sURL3 = GUICtrlRead ( Hostname3 $ ) $ sURL4 = GUICtrlRead ( Hostname4 $ ) $ sURL5 = GUICtrlRead ( Hostname5 $ ) $ sURL6 = GUICtrlRead ( hostname6 $ ) $ sURL7 = GUICtrlRead ( $ Hostname7 ) $ sURL8 = GUICtrlRead ( $ Hostname8) $ sURL9 = GUICtrlRead ( $ Hostname9 ) $ sURL10 = GUICtrlRead ( $ Hostname10 ) $ sURL11 = GUICtrlRead ( $ Hostname11 ) $ sURL12 = GUICtrlRead ( $ Hostname12 ) ; test de condition si vous avez des pertes de paquets Si Ping ( $ sURL , 999 ) > 0 Alors GUICtrlSetImage ( $ Status1 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname1 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status1 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname1 , 0xff0000 ) EndIf Si Ping ( $ sURL2 , 999 ) > 0, alors GUICtrlSetImage ( $ Status2 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ NomHôte2 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status2 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname2 , 0xff0000 ) EndIf Si Ping ( $ sURL3 , 999 ) > 0, alors GUICtrlSetImage ( $ Status3 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ NomHôte3 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status3 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname3 , 0xff0000 ) EndIf Si Ping ( $ sURL4 , 999 ) > 0, puis GUICtrlSetImage ( $ Status4 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ NomHôte4 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status4 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname4 , 0xff0000 ) EndIf Si Ping ( $ sURL5 , 999 ) > 0, alors GUICtrlSetImage ( $ Status5 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ NomHôte5 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status5 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname5 , 0xff0000 ) EndIf Si Ping ( $ sURL6 , 999 ) > 0, alors GUICtrlSetImage ( $ Status6 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname6 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status6 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname6 , 0xff0000 ) EndIf Si Ping ( $ sURL7 , 999 ) > 0, alors GUICtrlSetImage ( $ Status7 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname7 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status7 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname7 , 0xff0000 ) EndIf Si Ping ( $ sURL8 , 999 ) > 0, alors GUICtrlSetImage ( $ Status8 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname8 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status8 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname8 , 0xff0000 ) EndIf Si Ping ( $ sURL8 , 999 ) > 0, alors GUICtrlSetImage ( $ Status9 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname9 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status9 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname9 , 0xff0000 ) EndIf Si Ping ( $ sURL10 , 999 ) > 0, puis GUICtrlSetImage ( $ Status10 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname10 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status10 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname10 , 0xff0000 ) EndIf Si Ping ( $ sURL11 , 999 ) > 0, alors GUICtrlSetImage ( $ Status11 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname11 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status11 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname11 , 0xff0000 ) EndIf Si Ping ( $ sURL12 , 999 ) > 0, alors GUICtrlSetImage ( $ Status12 , @ScriptDir & "\ Green.ico" ) GUICtrlSetColor ( $ Hostname12 , 0x00ff00 ) Sinon GUICtrlSetImage ( $ Status12 , @ScriptDir & "\ Red.ico" ) GUICtrlSetColor ( $ Hostname12 , 0xff0000 ) EndIf Revenir EndFunc ; ==> CheckStats Func _ hkExitApp ( ) Sortie ; c’est cette partie qui me pose problème EndFunc ; ==> _ hkExitApp Jos I could not find the error Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 Just now, SANOGO said: Vous mélangez eventmode et mode normal pour l'interface graphique. Regardez cette version et voyez si vous comprenez: il y a encore quelques lignes de débogage afin que vous puissiez voir ce qui se passe. I give up and am done here . FrancescoDiMuro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 1 minute ago, Jos said: J'abandonne et j'ai fini ici. thank you for helping me; I will reflect well Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2019 Developers Share Posted June 2, 2019 No you don't ... You simply do not understand enough English to understand what I am saying, so I advise you to go to the french forum: https://www.autoitscript.fr/forum/ Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SANOGO Posted June 2, 2019 Author Share Posted June 2, 2019 2 minutes ago, Jos said: Non, vous ne comprenez pas suffisamment l'anglais pour comprendre ce que je dis. Je vous conseille donc de vous rendre sur le forum français: https://www.autoitscript.fr/forum/ Jos Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now