caramen Posted October 29, 2014 Share Posted October 29, 2014 Hello all I am getting confused becose i tried to code my GUI to be close and restarted after each while but i am getting stuck with this now .... I just want to Close each GUI without leave the script what did a do wrong ... For exemple if you try the script you have to use the section "Macro :" and lunch the macro "Creation d'enveloppe" if you do so you willl have 3 GUI windows openning i whould like to close each GUI without leave the application ... i tryed a lot of thing but i always fail :/ expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <ListViewConstants.au3> #include <ButtonConstants.au3> #include <GuiListView.au3> #include <File.au3> AutoItSetOption("WinDetectHiddenText", 1) HotKeySet("{ESCAPE}", "Exite") HotKeySet("{PAUSE}", "Pause") $SettingsFile = @SCRIPTDIR & '\Data\Settings.ini' $Variable1 = 0 Global $Paused Example() $S1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation',$S1+1) Func Example() ; Creation de l'interface Global $hGUI = GUICreate("Raccourcis outils", 400, 500) ; Creation de la liste combot Local $iComboBox = GUICtrlCreateCombo("Selectionnez un outil.", 90, 50, 190, 20) Local $iClose = GUICtrlCreateButton("Close", 280, 450, 85, 25) Local $iConnect = GUICtrlCreateButton("Go", 280, 48, 85, 25) Local $iConnect2 = GUICtrlCreateButton("Go", 280, 348, 85, 25) Local $iDoc = GUICtrlCreateButton("Documentation", 280, 380, 85, 25) ;~ Interrieure de la GUI GUICtrlCreateLabel ("Selectionner un Outil.", 80, 20, 180, 20) GUICtrlCreateLabel ("Outil :", 10, 52, 75, 20) GUICtrlCreateLabel ("Nombre d'utilisation logiciel :" , 10, 452, 175, 20) $S1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") GUICtrlCreateLabel ($S1, 150, 452, 75, 20) ; Addition des items combot (un item pour chaque Outil) GUICtrlSetData($iComboBox, "=======Client legé===========") GUICtrlSetData($iComboBox, "Alike") GUICtrlSetData($iComboBox, "AssetDB") GUICtrlSetData($iComboBox, "Chopin") GUICtrlSetData($iComboBox, "Conformité") GUICtrlSetData($iComboBox, "Delphes") GUICtrlSetData($iComboBox, "FIS") GUICtrlSetData($iComboBox, "Horus") GUICtrlSetData($iComboBox, "HP BladeSystem") GUICtrlSetData($iComboBox, "Infoblox") GUICtrlSetData($iComboBox, "Password Vault") GUICtrlSetData($iComboBox, "Saam") GUICtrlSetData($iComboBox, "=======Client lourd==========") GUICtrlSetData($iComboBox, "PCAC") GUICtrlSetData($iComboBox, "Putty") GUICtrlSetData($iComboBox, "Disquette anto") GUICtrlSetData($iComboBox, "=======Active directory=======") GUICtrlSetData($iComboBox, "AD Tech(APPS)") GUICtrlSetData($iComboBox, "AD Tech(Winrep)") GUICtrlSetData($iComboBox, "=======Vcenters===============") GUICtrlSetData($iComboBox, "Cloud prod") GUICtrlSetData($iComboBox, "Cloud H prod") GUICtrlSetData($iComboBox, "Vc-BP2S") GUICtrlSetData($iComboBox, "DNA") GUICtrlSetData($iComboBox, "VCenter mut") Local $iComboBox2 = GUICtrlCreateCombo("Selectionnez une macro.", 90, 350, 190, 20) GUICtrlCreateLabel ("Macro :", 10, 352, 75, 20) GUICtrlSetData($iComboBox2, "=======Macro========") GUICtrlSetData($iComboBox2, "Creation enveloppe windows") GUICtrlSetData($iComboBox2, "Demande de conformité") GUICtrlSetData($iComboBox2, "Declaration manager autosys") GUICtrlSetData($iComboBox2, "=====Connexion Firewall's=====") GUICtrlSetData($iComboBox2, "Connexion VCenter") GUICtrlSetData($iComboBox2, "Connexion Cloud H prod") GUICtrlSetData($iComboBox2, "Connexion Cloud prod") ;~ ================================Text defilant========================================== ;~ ======================================================================================== $label = GUICtrlCreateLabel("Fait par INTM pour BNP", 1000 ,1000 , 150, 15) Global $px = 0 , $speed = 10 ;~ ======================================================================================== ;~ ======================================================================================== ; Display de l'interface GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" ; Boucle j'usqua utilisation de la GUI. While 1 ;~ ================================Text defilant=========================================== ;~ ======================================================================================== $px -= 1 GUICtrlSetPos($label, $px, 0) if $px < -100 then $px = 500 ;~ ======================================================================================== ;~ ======================================================================================== Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iClose GUIDelete ($hGUI) ;~ GUIDelete ($hGUI2) ;~ GUIDelete ($Console) Exit Case $iDoc run (@SCRIPTDIR&"\Data\Procedures.hnd") Case $iComboBox $sComboRead = GUICtrlRead($iComboBox) If $sComboRead = "Horus" Then $Outil01 = IniRead ($SettingsFile, 'Informations', 'Outil01', "ERROR") $URL01 = IniRead ($SettingsFile, 'Informations', 'Chemin01', "ERROR") $definition01 = IniRead ($SettingsFile, 'Informations', 'definition01', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil01 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL01 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Horus ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition01 , 70, 225, 120, 100) ElseIf $sComboRead = "HP BladeSystem" Then $Outil02 = IniRead ($SettingsFile, 'Informations', 'Outil02', "ERROR") $URL02 = IniRead ($SettingsFile, 'Informations', 'Chemin02', "ERROR") $definition02 = IniRead ($SettingsFile, 'Informations', 'definition02', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil02 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL02 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert HP BladeSystem ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition02 , 70, 225, 120, 100) ElseIf $sComboRead = "Alike" Then $Outil03 = IniRead ($SettingsFile, 'Informations', 'Outil03', "ERROR") $URL03 = IniRead ($SettingsFile, 'Informations', 'Chemin03', "ERROR") $definition03 = IniRead ($SettingsFile, 'Informations', 'definition03', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil03 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL03 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Alike", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition03 , 70, 225, 120, 100) ElseIf $sComboRead = "AD Tech(APPS)" Then $Outil04 = IniRead ($SettingsFile, 'Informations', 'Outil04', "ERROR") $URL04 = IniRead ($SettingsFile, 'Informations', 'Chemin04', "ERROR") $definition04 = IniRead ($SettingsFile, 'Informations', 'definition04', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil04 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL04 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AD Tech(APPS)", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition04 , 70, 225, 120, 100) ElseIf $sComboRead = "AD Tech(Winrep)" Then $Outil05 = IniRead ($SettingsFile, 'Informations', 'Outil05', "ERROR") $URL05 = IniRead ($SettingsFile, 'Informations', 'Chemin05', "ERROR") $definition05 = IniRead ($SettingsFile, 'Informations', 'definition05', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil05 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL05 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AD Tech(Winrep)", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition05 , 70, 225, 120, 100) ElseIf $sComboRead = "AssetDB" Then $Outil06 = IniRead ($SettingsFile, 'Informations', 'Outil06', "ERROR") $URL06 = IniRead ($SettingsFile, 'Informations', 'Chemin06', "ERROR") $definition06 = IniRead ($SettingsFile, 'Informations', 'definition06', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil06 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL06 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert AssetDB", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition06 , 70, 225, 120, 100) ElseIf $sComboRead = "Chopin" Then $Outil07 = IniRead ($SettingsFile, 'Informations', 'Outil07', "ERROR") $URL07 = IniRead ($SettingsFile, 'Informations', 'Chemin07', "ERROR") $definition07 = IniRead ($SettingsFile, 'Informations', 'definition07', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil07 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL07 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Chopin", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition07 , 70, 225, 120, 100) ElseIf $sComboRead = "Conformité" Then $Outil08 = IniRead ($SettingsFile, 'Informations', 'Outil08', "ERROR") $URL08 = IniRead ($SettingsFile, 'Informations', 'Chemin08', "ERROR") $definition08 = IniRead ($SettingsFile, 'Informations', 'definition08', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil08 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL08 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la Conformité ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition08 , 70, 225, 120, 100) ElseIf $sComboRead = "Delphes" Then $Outil09 = IniRead ($SettingsFile, 'Informations', 'Outil09', "ERROR") $URL09 = IniRead ($SettingsFile, 'Informations', 'Chemin09', "ERROR") $definition09 = IniRead ($SettingsFile, 'Informations', 'definition09', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil09 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL09 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la Delphes ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition09 , 70, 225, 120, 100) ElseIf $sComboRead = "FIS" Then $Outil10 = IniRead ($SettingsFile, 'Informations', 'Outil10', "ERROR") $URL10 = IniRead ($SettingsFile, 'Informations', 'Chemin10', "ERROR") $definition10 = IniRead ($SettingsFile, 'Informations', 'definition10', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil10 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL10 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert la FIS ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition10 , 70, 225, 120, 100) ElseIf $sComboRead = "Infoblox" Then $Outil11 = IniRead ($SettingsFile, 'Informations', 'Outil11', "ERROR") $URL11 = IniRead ($SettingsFile, 'Informations', 'Chemin11', "ERROR") $definition11 = IniRead ($SettingsFile, 'Informations', 'definition11', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil11 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL11 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Infoblox ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition11 , 70, 225, 120, 100) ElseIf $sComboRead = "Password Vault" Then $Outil12 = IniRead ($SettingsFile, 'Informations', 'Outil12', "ERROR") $URL12 = IniRead ($SettingsFile, 'Informations', 'Chemin12', "ERROR") $definition12 = IniRead ($SettingsFile, 'Informations', 'definition12', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil12 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL12 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Infoblox ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition12 , 70, 225, 120, 100) ElseIf $sComboRead = "Saam" Then $Outil13 = IniRead ($SettingsFile, 'Informations', 'Outil13', "ERROR") $URL13 = IniRead ($SettingsFile, 'Informations', 'Chemin13', "ERROR") $definition13 = IniRead ($SettingsFile, 'Informations', 'definition13', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil13 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL13 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Saam ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition13 , 70, 225, 120, 100) ElseIf $sComboRead = "Cloud prod" Then $Outil14 = IniRead ($SettingsFile, 'Informations', 'Outil14', "ERROR") $URL14 = IniRead ($SettingsFile, 'Informations', 'Chemin14', "ERROR") $definition14 = IniRead ($SettingsFile, 'Informations', 'definition14', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil14 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL14 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC Cloud prod ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition14 , 70, 225, 120, 100) ElseIf $sComboRead = "Cloud H prod" Then $Outil15 = IniRead ($SettingsFile, 'Informations', 'Outil15', "ERROR") $URL15 = IniRead ($SettingsFile, 'Informations', 'Chemin15', "ERROR") $definition15 = IniRead ($SettingsFile, 'Informations', 'definition15', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil15 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL15 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC Cloud h prod ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition15 , 70, 225, 120, 100) ElseIf $sComboRead = "Vc-BP2S" Then $Outil16 = IniRead ($SettingsFile, 'Informations', 'Outil16', "ERROR") $URL16 = IniRead ($SettingsFile, 'Informations', 'Chemin16', "ERROR") $definition16 = IniRead ($SettingsFile, 'Informations', 'definition16', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil16 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL16 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC BP2S ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition16 , 70, 225, 120, 100) ElseIf $sComboRead = "DNA" Then $Outil17 = IniRead ($SettingsFile, 'Informations', 'Outil17', "ERROR") $URL17 = IniRead ($SettingsFile, 'Informations', 'Chemin17', "ERROR") $definition17 = IniRead ($SettingsFile, 'Informations', 'definition17', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil17 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL17 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert le VC DNA ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition17 , 70, 225, 120, 100) ElseIf $sComboRead = "Putty" Then $Outil18 = IniRead ($SettingsFile, 'Informations', 'Outil18', "ERROR") $URL18 = IniRead ($SettingsFile, 'Informations', 'Chemin18', "ERROR") $definition18 = IniRead ($SettingsFile, 'Informations', 'definition18', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil18 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL18 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Putty ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition18 , 70, 225, 120, 100) ElseIf $sComboRead = "Disquette anto" Then $Outil19 = IniRead ($SettingsFile, 'Informations', 'Outil19', "ERROR") $URL19 = IniRead ($SettingsFile, 'Informations', 'Chemin19', "ERROR") $definition19 = IniRead ($SettingsFile, 'Informations', 'definition19', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil19 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL19 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert Disquette anto ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition19 , 70, 225, 120, 100) ElseIf $sComboRead = "VCenter mut" Then $Outil20 = IniRead ($SettingsFile, 'Informations', 'Outil20', "ERROR") $URL20 = IniRead ($SettingsFile, 'Informations', 'Chemin20', "ERROR") $definition20 = IniRead ($SettingsFile, 'Informations', 'definition20', "ERROR") GUICtrlCreateLabel ("Nom outil:", 50, 100, 150, 20) GUICtrlCreateLabel ( $Outil20 , 70, 125, 155, 20) GUICtrlCreateLabel ("Adresse de l'outil:", 50, 150, 150, 20) GUICtrlCreateLabel ( $URL20 , 70, 175, 250, 20) GUICtrlCreateLabel ("A quoi sert VCenter mut ?", 50, 200, 150, 20) GUICtrlCreateLabel ( $definition20 , 70, 225, 120, 100) Else Sleep(200) ;~ MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) ;~ run( "C:\Windows\System32\mstsc.exe"&" /admin /v:MGNET"&$sComboRead&"-sv005") EndIf ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= ;=====================================CONNEXION A L OUTIL DESIRER ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= Case $iConnect If $sComboRead = "Horus" Then $S2 = IniRead ($SettingsFile, 'Stats', 'Utilisation Horus', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Horus',$S2+1) GUICtrlCreateLabel ("Nombre d'utilisation horus:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S2, 150, 432, 75, 20) Local $oIE = _IECreate($URL01, 1) ElseIf $sComboRead = "HP BladeSystem" Then $S3 = IniRead ($SettingsFile, 'Stats', 'Utilisation HP,BS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation HP,BS',$S3+1) GUICtrlCreateLabel ("Nombre d'utilisation HP,BS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S3, 150, 432, 75, 20) $A=InputBox("BarreCode", "Renseignez votre barrecode NE PAS OUBLIER LE POINT.") $B=InputBox("FQDN", "Renseignez le FQDN.") $URL02BIS = $A&$B Local $oIE = _IECreate($URL02BIS, 1) ElseIf $sComboRead = "Alike" Then $S4 = IniRead ($SettingsFile, 'Stats', 'Utilisation Alike', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Alike',$S4+1) GUICtrlCreateLabel ("Nombre d'utilisation Alike:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S4, 150, 432, 75, 20) Local $oIE = _IECreate($URL03, 1) ElseIf $sComboRead = "AD Tech(APPS)" Then $S5 = IniRead ($SettingsFile, 'Stats', 'Utilisation APPS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation APPS',$S5+1) GUICtrlCreateLabel ("Nombre d'utilisation APPS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S5, 150, 432, 75, 20) run( "C:\Windows\System32\mstsc.exe"&" /admin /v:s00v09927223") ElseIf $sComboRead = "AD Tech(Winrep)" Then $S6 = IniRead ($SettingsFile, 'Stats', 'Utilisation Winrep', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Winrep',$S6+1) GUICtrlCreateLabel ("Nombre d'utilisation Winrep:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S6, 150, 432, 75, 20) run( "C:\Windows\System32\mstsc.exe"&" /admin /v:Winrep") ElseIf $sComboRead = "AssetDB" Then $S7 = IniRead ($SettingsFile, 'Stats', 'Utilisation AssetDB', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation AssetDB',$S7+1) GUICtrlCreateLabel ("Nombre d'utilisation AssetDB:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S7, 150, 432, 75, 20) Local $oIE = _IECreate($URL06, 1) ElseIf $sComboRead = "Chopin" Then $S8 = IniRead ($SettingsFile, 'Stats', 'Utilisation Chopin', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Chopin',$S8+1) GUICtrlCreateLabel ("Nombre d'utilisation Chopin:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S8, 150, 432, 75, 20) Local $oIE = _IECreate($URL07, 1) ElseIf $sComboRead = "Conformité" Then $S9 = IniRead ($SettingsFile, 'Stats', 'Utilisation Conformité', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Conformité',$S9+1) GUICtrlCreateLabel ("Nombre d'utilisation Conformité:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S9, 160, 432, 75, 20) Local $oIE = _IECreate($URL08, 1) ElseIf $sComboRead = "Delphes" Then $S10 = IniRead ($SettingsFile, 'Stats', 'Utilisation Delphes', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Delphes',$S10+1) GUICtrlCreateLabel ("Nombre d'utilisation Delphes:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S10, 150, 432, 75, 20) Local $oIE = _IECreate($URL09, 1) ElseIf $sComboRead = "FIS" Then $S11 = IniRead ($SettingsFile, 'Stats', 'Utilisation FIS', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation FIS',$S11+1) GUICtrlCreateLabel ("Nombre d'utilisation FIS:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S11, 150, 432, 75, 20) Local $oIE = _IECreate($URL10, 1) ElseIf $sComboRead = "Infoblox" Then $S12 = IniRead ($SettingsFile, 'Stats', 'Utilisation Infoblox', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Infoblox',$S12+1) GUICtrlCreateLabel ("Nombre d'utilisation Infoblox:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S12, 150, 432, 75, 20) Local $oIE = _IECreate($URL11, 1) ElseIf $sComboRead = "Password Vault" Then $S13 = IniRead ($SettingsFile, 'Stats', 'Utilisation Vault', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Vault',$S13+1) GUICtrlCreateLabel ("Nombre d'utilisation Vault:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S13, 150, 432, 75, 20) Local $oIE = _IECreate($URL12, 1) ElseIf $sComboRead = "Saam" Then $S14 = IniRead ($SettingsFile, 'Stats', 'Utilisation Saam', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Saam',$S14+1) GUICtrlCreateLabel ("Nombre d'utilisation Saam:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S14, 150, 432, 75, 20) Local $oIE = _IECreate($URL13, 1) ElseIf $sComboRead = "Cloud prod" Then $S15 = IniRead ($SettingsFile, 'Stats', 'Utilisation CloudP', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation CloudP',$S15+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudP:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S15, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarecloudprod.cmd" ) ElseIf $sComboRead = "Cloud H prod" Then $S16 = IniRead ($SettingsFile, 'Stats', 'Utilisation CloudNP', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation CloudNP',$S16+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudNP:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S16, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarecloudhprod.cmd" ) ElseIf $sComboRead = "Vc-BP2S" Then $S17 = IniRead ($SettingsFile, 'Stats', 'Utilisation Vc-BP2S', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Vc-BP2S',$S17+1) GUICtrlCreateLabel ("Nombre d'utilisation Vc-BP2S:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S17, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwarebp2s.cmd" ) ElseIf $sComboRead = "DNA" Then $S18 = IniRead ($SettingsFile, 'Stats', 'Utilisation DNA', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation DNA',$S18+1) GUICtrlCreateLabel ("Nombre d'utilisation DNA:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S18, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwareDNA.cmd" ) ElseIf $sComboRead = "Putty" Then $S19 = IniRead ($SettingsFile, 'Stats', 'Utilisation Putty', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Putty',$S19+1) GUICtrlCreateLabel ("Nombre d'utilisation Putty:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S19, 150, 432, 75, 20) run ($URL18) ElseIf $sComboRead = "Disquette anto" Then $S20 = IniRead ($SettingsFile, 'Stats', 'Utilisation Disquette', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation Disquette',$S20+1) GUICtrlCreateLabel ("Nombre d'utilisation Disquette:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S20, 160, 432, 75, 20) run ($URL19) ElseIf $sComboRead = "VCenter mut" Then $S21 = IniRead ($SettingsFile, 'Stats', 'Utilisation VCenter mut', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation VCenter mut',$S21+1) GUICtrlCreateLabel ("Nombre d'utilisation VCenter mut:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S21, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\vmwaremut.cmd" ) Else MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) ;~ run( "C:\Windows\System32\mstsc.exe"&" /admin /v:MGNET"&$sComboRead&"-sv005") EndIf ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= ;=====================================MACRO's ;========================================================================================================================================= ;========================================================================================================================================= ;========================================================================================================================================= Case $iComboBox2 $sComboRead2 = GUICtrlRead($iComboBox2) If $sComboRead2 = "Creation enveloppe windows" Then GUICtrlCreateLabel ("Aide:", 80, 380, 100, 100) GUICtrlCreateLabel ("'Creation enveloppe windows' sert a créer les enveloppe automatiquement.",110, 380, 150, 80) ElseIf $sComboRead2 = "Demande de conformité" Then GUICtrlCreateLabel ("Aide:", 80, 380, 190, 20) GUICtrlCreateLabel ("La macro Demande de conformité sert a faire une demande de conformité.",110, 380, 150, 100) ElseIf $sComboRead2 = "Declaration manager autosys" Then GUICtrlCreateLabel ("Aide:", 80, 380, 190, 20) GUICtrlCreateLabel ("La macro Declaration manager autosys sert a declaré un manager Autosys.",110, 380, 150, 100) Else Sleep(500) ;~ MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) EndIf ;~ MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead2, 0, $hGUI) Case $iConnect2 $sComboRead2 = GUICtrlRead($iComboBox2) If $sComboRead2 = "Creation enveloppe windows" Then Macro1 () ElseIf $sComboRead2 = "Demande de conformité" Then Macro2 () ElseIf $sComboRead2 = "Declaration manager autosys" Then Macro3 () ElseIf $sComboRead2 = "Connexion VCenter" Then $S22 = IniRead ($SettingsFile, 'Stats', 'Connexion VCenter', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion VCenter',$S22+1) GUICtrlCreateLabel ("Nombre d'utilisation Connexion VCenter:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S22, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\Firewall manuel VCenter.bat" ) ElseIf $sComboRead2 = "Connexion Cloud H prod" Then $S23 = IniRead ($SettingsFile, 'Stats', 'Connexion Cloud H prod', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion Cloud H prod',$S23+1) GUICtrlCreateLabel ("Nombre d'utilisation Connexion Cloud H prod:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S23, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\Firewall manuel CloudHProd.bat" ) ElseIf $sComboRead2 = "Connexion Cloud prod" Then $S24 = IniRead ($SettingsFile, 'Stats', 'Connexion Cloud prod', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Connexion Cloud prod',$S24+1) GUICtrlCreateLabel ("Nombre d'utilisation CloudProd:" , 10, 432, 175, 20) GUICtrlCreateLabel ($S24, 150, 432, 75, 20) run (@SCRIPTDIR&"\Data\firewall manuel Cloud prod.bat" ) Else MsgBox($MB_SYSTEMMODAL, "", "Choisissez un élément" ) EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Func Macro1 () Local $iHotRamB = 2 Local $iBiosB = 2 Local $iTserviceB = 2 Local $iTVersionB = 2 ;~ ================================================Console============================================== Global $Console = GUICreate("Console", 300, 300) Global $ConsoleArea = GUICtrlCreateListView("Console ", 10,10 , 280, 280,$LVS_REPORT) GUISetState(@SW_SHOW, $Console) ;==================================== Creation de l'interface enveloppe ================================ Global $hGUI2 = GUICreate("Création de l'enveloppe", 350, 350) ; Creation du formulaire Local $iGoo = GUICtrlCreateButton("Goo", 210, 260, 100, 20) Local $iNomserveurA = GUICtrlCreateInput ("s00v099", 20, 20, 100, 20) Local $iSocketA = GUICtrlCreateInput ("Socket", 20, 50, 100, 20) Local $iProcA = GUICtrlCreateInput ("Processeur", 20, 80, 100, 20) Local $iRamA = GUICtrlCreateInput ("Ram", 20, 110, 100, 20) Local $iHDD1A = GUICtrlCreateInput ("HDD1", 20, 140, 100, 20) Local $iHDD2A = GUICtrlCreateInput ("HDD2", 20, 170, 100, 20) Local $iHDD3A = GUICtrlCreateInput ("HDD3", 20, 200, 100, 20) Local $iHDD4A = GUICtrlCreateInput ("HDD4", 20, 230, 100, 20) Local $iHDD5A = GUICtrlCreateInput ("HDD5", 20, 260, 100, 20) Local $iHDD6A = GUICtrlCreateInput ("HDD6", 20, 290, 100, 20) Local $iHotRam = GUICtrlCreateCheckbox ("Branchement RAM a chaud", 180, 20, 150, 20) Local $iBios = GUICtrlCreateCheckbox ("Bios au demarrage ?", 180, 50, 150, 20) Local $iTService = GUICtrlCreateCheckbox ("ItService?", 180, 80, 150, 20) Local $iTVersionA = GUICtrlCreateInput ("IT Version?", 180, 110, 150, 20) Local $iTVersionLabel = GUICtrlCreateLabel ("4.0 ou 5.0 ou 5.1", 180, 140, 150, 20) Global $Console = GUICtrlCreateLabel ("Log :", 180, 180, 150, 50) ; Display de l'interface GUISetState(@SW_SHOW, $hGUI2) ;~ ======================================================================================================= MsgBox($MB_SYSTEMMODAL, "Merci", "Renseignez le formulaire suivant svp. Puis apuyer sur Goo") While (1) Switch GUIGetMsg () Case $GUI_EVENT_CLOSE GUIDelete ($hGUI) GUIDelete ($hGUI2) GUIDelete ($Console) ExitLoop Case $iGoo ;~ =====================================Variable déclaration pour la console====================== $iNomserveurB = GUICtrlRead($iNomserveurA) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Activation de la fenêtre ") _GUICtrlListView_AddItem($ConsoleArea,"Activation de la fenêtre") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ; scroll to the end of ListView For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ WinMove ("Raccourcis outils","",950,0) WinMove ("Création de l'enveloppe","",950,320) WinMove ("Console","",950,0) WinActivate ("Créer une nouvelle machine virtuelle","") If WinActivate ("Créer une nouvelle machine virtuelle","") then Sleep (200) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Déplacement de la fenêtre ") _GUICtrlListView_AddItem($ConsoleArea,"Déplacement de la fenêtre ") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ WinMove ("Créer une nouvelle machine virtuelle","",0,0) Sleep(200) ;~ Install personnalisé GUICtrlSetData ( $Console, "Log : Custome Enveloppe ") _GUICtrlListView_AddItem($ConsoleArea,"Custome Enveloppe") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next MouseClick("left",232,203,1) Sleep (200) ;~ Suivant MouseClick("left",573,650,1) Sleep (200) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Nom du serveur_"&$iNomserveurB) _GUICtrlListView_AddItem($ConsoleArea,"Nom du serveur_"&$iNomserveurB) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On renseigne le nom du serveur $iNomserveurB = GUICtrlRead($iNomserveurA) Send($iNomserveurB) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) Sleep (200) ;~ On selectionne le LUN ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Selectionné le LUN SVP ") _GUICtrlListView_AddItem($ConsoleArea,"Selection LUN") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ MsgBox($MB_SYSTEMMODAL, "Merci", "Selectionnez le LUN manuellement. Puis valider.") Sleep(200) ;~ Suivant MouseClick("left",573,650,1) Sleep (200) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Version 8 ") _GUICtrlListView_AddItem($ConsoleArea,"Version 8") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ VM version_8 MouseClick("left",257,339,1) ;~ Suivant MouseClick("left",573,650,1) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Processeur & Socket") _GUICtrlListView_AddItem($ConsoleArea,"Processeur & Socket") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ Processeur et socket $iSocketB = GUICtrlRead($iSocketA) While (1) If $iSocketB = 1 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Socket=1") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ Sleep(200) ExitLoop ElseIf $iSocketB = 2 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Socket=2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 2 socket MouseClick("left",463,168,1) Sleep(200) ExitLoop ElseIf $iSocketB= 3 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Socket=3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 3 socket MouseClick("left",457,181,1) Sleep(200) ExitLoop ElseIf $iSocketB= 4 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Socket=4") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",489,130,1) ;~ On selectionne 4 socket MouseClick("left",460,189,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd $iProcB = GUICtrlRead($iProcA) While(1) If $iProcB = 1 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Proce=1") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ Sleep(200) ExitLoop ElseIf $iProcB = 2 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Proce=2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 2 socket MouseClick("left",454,195,1) Sleep(200) ExitLoop ElseIf $iProcB= 3 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Proce=3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 3 socket MouseClick("left",454,207,1) Sleep(200) ExitLoop ElseIf $iProcB= 4 Then ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Proce=4") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On clique le combot list MouseClick("left",459,168,1) ;~ On selectionne 4 socket MouseClick("left",460,221,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd ;~ Suivant MouseClick("left",573,650,1) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : RAM ") _GUICtrlListView_AddItem($ConsoleArea,"Config RAM") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On controle la ram $iRamB = GUICtrlRead($iRamA) MouseClick("left",385,146,1) Send("{DEL}") Sleep(200) ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Ram="&$iRamB) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ Send($iRamB) ;~ Suivant MouseClick("left",573,650,1) GUICtrlSetData ( $Console, "Log :Selectionner le VLan Manuellement ") _GUICtrlListView_AddItem($ConsoleArea,"Selection VLan") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next MsgBox($MB_SYSTEMMODAL, "Merci", "Selectionnez le VLAN manuellement. Puis valider.") ;~ Suivant MouseClick("left",573,650,1) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) Sleep(200) ;~ On selectionne le combot MouseClick("left",302,144,1) Send("{DEL}") Sleep(200) Send("{DEL}") ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : HDD ") _GUICtrlListView_AddItem($ConsoleArea,"HDD") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ On selectionne la volumetrie du HDD $iHDD1B = GUICtrlRead ($iHDD1A) ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"HDD1="&$iHDD1B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ Send($iHDD1B) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) Sleep(200) ;~ Suivant MouseClick("left",573,650,1) ;~ On selectionne le mode edition ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Pause 5 sec") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ GUICtrlSetData ( $Console, "Log : Attente 7 ") ;~ Sleep(1000) ;~ GUICtrlSetData ( $Console, "Log : Attente 6 ") ;~ Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 5 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 4 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 3 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 2 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 1 ") Sleep(1000) GUICtrlSetData ( $Console, "Log : Attente 0 ") Sleep(500) ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : Go ") _GUICtrlListView_AddItem($ConsoleArea,"Pause OK") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ MouseClick("left",198,571,1) Sleep(200) ;~ Continuer MouseClick("left",581,653,1) Sleep(200) $iHDD2B = GUICtrlRead ($iHDD2A) While (1) ;~=================================HDD2 setup=================================================== If $iHDD2B = ("HDD2") Then ExitLoop Else ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : HDD2 ") _GUICtrlListView_AddItem($ConsoleArea,"HDD2") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ Sleep(1000) WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) Sleep(500) MouseClick("left",247,75,1) Sleep(1500) WinWaitActive ("Ajouter du matériel","") WinActivate ("Ajouter du matériel","") If WinActivate ("Ajouter du matériel","") then WinMove ("Ajouter du matériel","",0,0) MouseClick("left",229,290,1) Sleep(200) MouseClick("left",527,481,1) Sleep(200) MouseClick("left",529,479,1) Sleep(200) Send("{DEL}") Sleep(200) Send("{DEL}") Sleep(200) Send($iHDD2B) ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"HDD2="&$iHDD2B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ MouseClick("left",516,486,1) Sleep(200) MouseClick("left",516,486,1) Sleep(200) MouseClick("left",516,486,1) ExitLoop Else ExitLoop EndIf Else ExitLoop EndIf EndIf WEnd $iHDD3B = GUICtrlRead ($iHDD3A) While (1) ;~ ======================================HDD3 setup=========================================================== If $iHDD3B = ("HDD3") Then ExitLoop Else ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"HDD3") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ GUICtrlSetData ( $Console, "Log : HDD3 ") Sleep(500) WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) ;~ Onclique ajouté. MouseClick("left",247,75,1) Sleep(200) WinWaitActive ("Ajouter du matériel","") WinActivate ("Ajouter du matériel","") If WinActivate ("Ajouter du matériel","") then WinMove ("Ajouter du matériel","",0,0) MouseClick("left",229,290,1) Sleep(200) MouseClick("left",527,481,1) Sleep(200) MouseClick("left",529,479,1) Sleep(200) Send("{DEL}") Sleep(200) Send("{DEL}") Sleep(200) Send($iHDD3B) ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"HDD3="&$iHDD3B) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ MouseClick("left",516,486,1) Sleep(200) MouseClick("left",516,486,1) Sleep(200) MouseClick("left",516,486,1) Sleep(200) ExitLoop Else ExitLoop EndIf Else ExitLoop EndIf EndIf WEnd WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") ;~ If WinActivate ($iNomServeurB&" - Propriétés de machine virtuelle","") then WinMove ($iNomServeurB&" - Propriétés de machine virtuelle","",0,0) ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"RAM/CPU a Chaud") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ GUICtrlSetData ( $Console, "Log : RAM/CPU a Chaud ") ;~ Branchement memoire a chaud While (1) If $iHotRamB = 1 Then Sleep(200) ;~ Option MouseClick("left",82,40,1) Sleep(200) ;~ Selection ligne MouseClick("left",179,206,1) Sleep(200) ;~ Activation du CPU a chaud MouseClick("left",412,335,1) Sleep(200) ;~ Activation de la RAM a chaud MouseClick("left",394,185,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd ;~ Demarrage sur le bios ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"Bios au demarrage") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ GUICtrlSetData ( $Console, "Log : Bios au demarrage ") While (1) If $iBiosB = 1 Then ;~ Option MouseClick("left",82,40,1) Sleep(200) ;~ Option demarrage MouseClick("left",101,225,1) Sleep(200) ;~ On active le bios au demarrage MouseClick("left",411,306,1) Sleep(200) ExitLoop Else ExitLoop EndIf WEnd ;~ ===========================================================LOG================================= GUICtrlSetData ( $Console, "Log : ITService Version ") _GUICtrlListView_AddItem($ConsoleArea,"ITService Version") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ;~ ITServiceDesk While (1) If $iTServiceB = 1 Then ;~ Option MouseClick("left",82,40,1) Sleep(200) ;~ General MouseClick("left",95,174,1) Sleep(200) ;~ Parametre de configuration MouseClick("left",549,352,1) Sleep(200) WinMove ("Paramètres de configuration","",0,0) Sleep(200) MouseClick("left",549,352,1) Sleep(200) MouseClick("left",548,416,1) Sleep(200) $iTVersionB = GUICtrlRead($iTVersionA) While (1) If $iTVersionB = "IT Version4.0" Then $iTVersionB = 4.0 If $iTVersionB = "IT Version5.0" Then $iTVersionB = 5.0 If $iTVersionB = "IT Version5.1" Then $iTVersionB = 5.1 If $iTVersionB = 4.0 Then Send("machine.id") Sleep(200) Send("{TAB}") Sleep(200) Send("ITServiceV1.0") ExitLoop ElseIf $iTVersionB = 5.0 Then Send("machine.id") Sleep(200) Send("{TAB}") Sleep(200) Send("ITServiceV2.0") ExitLoop Elseif $iTVersionB = 5.1 Then Send("machine.id") Sleep(200) Send("{TAB}") Sleep(200) Send("ITServiceV3.0") ExitLoop Else ExitLoop EndIf WEnd MouseClick("left",399,452,1) ExitLoop Else ExitLoop EndIf WEnd ;~ ===========================================================LOG================================= _GUICtrlListView_AddItem($ConsoleArea,"ITServiceV="&$iTVersionB) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Stats", "Stats Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next ;~ ============================================================================================ ExitLoop EndIf Case $iHotRam If _IsChecked($iHotRam) Then $IHotRamB = 1 Else $IHotRamB = 0 EndIf Case $iBios If _IsChecked($iBios) Then $IBiosB = 1 Else $IBiosB = 0 EndIf Case $iTService If _IsChecked($iTService) Then $iTServiceB = 1 Else $iTServiceB = 0 EndIf EndSwitch WEnd ;~ IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe", $Console) ;~ IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe", $ConsoleArea) GUIDelete ($hGUI) GUIDelete ($hGUI2) GUIDelete ($Console) Example () EndFunc Func Macro2 () ;~ $URL09 = IniRead ($SettingsFile, 'Informations', 'Chemin09', "ERROR") ;~ Local $oIE = _IECreate($URL09, 1) Run ("C:\Program Files\Microsoft Application Virtualization Client\sfttray.exe") WinWait ("BMC Remedy User - Console BP²I FR (Recherche)","") Sleep (100) MsgBox($MB_SYSTEMMODAL, "Merci", "Veuillez vous logué svp."&@CRLF&"Puis cliquer sur OK.") GUIDelete ($hGUI) Example () EndFunc Func Macro3 () Sleep (2000) GUIDelete ($hGUI) Example () EndFunc Func Exite () Exit EndFunc Func Pause() GUICtrlSetData ( $Console, "Log : Pause ") _GUICtrlListView_AddItem($ConsoleArea,"Pause") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next $Paused = NOT $Paused While $Paused Sleep (500) WEnd GUICtrlSetData ( $Console, "Log : Marche ") _GUICtrlListView_AddItem($ConsoleArea,"Marche") _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) For $I = 0 To _GUICtrlListView_GetItemCount($ConsoleArea)- 1 IniWrite(@ScriptDir & "\Log.ini", "Log", "Log Enveloppe" & $I, _GUICtrlListView_GetItemTextString($ConsoleArea, $I)) Next EndFunc; => Pause() Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Regards... My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Solution dewcansam Posted October 29, 2014 Solution Share Posted October 29, 2014 Don't use 'GUIDelete' that kills the GUI window. Use something like: GUISetState(@SW_HIDE, $hHelpWindow); I did not do any testing on your script, but keep in mind 'GUIDelete' kills the windows never to return. I could not find any 'Exit' s that would hinder your script. So, Hiding the windows might be the trick your after. Link to comment Share on other sites More sharing options...
caramen Posted October 30, 2014 Author Share Posted October 30, 2014 true, that solved my probleme but i did a couple of change Thanks. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki 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