Voici mon code. Un fichier txt est joint au message. Il contient le nom des villes.
► Afficher le texte
Code : Tout sélectionner
#requireadmin
#include <File.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Global $DbName = "place.txt"
Dim $FileRead, $Data
Global $Form1, $Btn1, $Combo
_FileReadToArray($DbName, $FileRead)
$Data = _ArrayToString($FileRead, "|", 1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Btn1
SplashOff()
#include <GuiButton.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Opt ("TrayIconDebug", 1)
Opt ("TrayAutoPause", 0)
Opt ("TrayOnEventMode", 1)
Opt ("ExpandEnvStrings", 1)
Opt ("WinDetectHiddenText", 1)
Local $Msg, $button1, $button2, $button3
$Path = @ScriptDir
$Form1 = GUICreate ("Menu d'installation de logiciels", 480, 340, 200, 200)
$Label2 = GUICtrlCreateLabel ("Ville:", 20, 30, 300, 17)
$CmbTitle="Choisissez une ville..."
$Combo = GUICtrlCreateCombo($CmbTitle, 140, 30, 220, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$place = GUICtrlRead($Combo)
GUICtrlSetData($Combo, $Data)
GUISetState(@SW_SHOW)
GUISetBkColor (0xf0f8ff)
$Label1 = GUICtrlCreateLabel ("Sélectionner les logiciels à installer", 100, 1, 300, 17)
Local Const $sFont = "Comic Sans Ms"
GUICtrlSetFont($Label1, 10, 400, 4, $sFont)
GUICtrlSetFont($Label2, 10, 400, 4, $sFont)
GUICtrlCreateGroup ("Logiciel", 20, 68, 350, 230)
$Radio1 = GUICtrlCreateCheckbox (" Logiciel1", 30, 90, 140, 17)
$Radio2 = GUICtrlCreateCheckbox (" Logiciel2", 30, 110, 140, 17)
$Radio3 = GUICtrlCreateCheckbox (" Logiciel3", 30, 130, 140, 17)
$Radio4 = GUICtrlCreateCheckbox (" Logiciel4", 30, 150, 138, 17)
$Radio5 = GUICtrlCreateCheckbox (" Logiciel5", 30, 170, 140, 17)
$Radio6 = GUICtrlCreateCheckbox (" Logiciel6", 30, 190, 140, 17)
$Radio7 = GUICtrlCreateCheckbox (" Logiciel7", 30, 210, 140, 17)
$Radio8 = GUICtrlCreateCheckbox (" Logiciel8", 30, 230, 190, 17)
$Radio9 = GUICtrlCreateCheckbox (" Logiciel9", 30, 250, 140, 17)
$Radio10 = GUICtrlCreateCheckbox (" Logiciel10", 30, 270, 140, 17)
$Radio11 = GUICtrlCreateCheckbox (" Logiciel11", 210, 90, 140, 17)
$Radio12 = GUICtrlCreateCheckbox (" Logiciel12", 210, 110, 140, 17)
$Radio13 = GUICtrlCreateCheckbox (" Logiciel13", 210, 130, 150, 17)
$Button1 = GUICtrlCreateButton ("Démarrer", 20, 305, 129, 25, 0)
GUISetState()
$Button2 = GUICtrlCreateButton ("Sélectionner tous", 180, 305, 129, 25, 0)
GUISetState()
$Button3 = GUICtrlCreateButton ("Déselectionner tous", 330, 305, 129, 25, 0)
GUISetState()
While 1
$Msg = GuiGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $button1
If BitAND (GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then
;Chemin pour l'installation du logiciel 1
_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio2), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 2
_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio3), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 3
_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio4), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 4
_GUICtrlButton_SetCheck($Radio4, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio5), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 5
_GUICtrlButton_SetCheck($Radio5, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio6), $GUI_CHECKED) = $GUI_CHECKED then
;Chemin pour l'installation du logiciel 6
_GUICtrlButton_SetCheck($Radio6, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio7), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 7
_GUICtrlButton_SetCheck($Radio7, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio8), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 8
_GUICtrlButton_SetCheck($Radio8, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio9), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 9
_GUICtrlButton_SetCheck($Radio9, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio10), $GUI_CHECKED) = $GUI_CHECKED then
;Chemin pour l'installation du logiciel 10
_GUICtrlButton_SetCheck($Radio10, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio11), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 11
_GUICtrlButton_SetCheck($Radio11, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio12), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 12
_GUICtrlButton_SetCheck($Radio12, $BST_UNCHECKED)
EndIf
If BitAND (GUICtrlRead($Radio13), $GUI_CHECKED) = $GUI_CHECKED Then
;Chemin pour l'installation du logiciel 13
_GUICtrlButton_SetCheck($Radio13, $BST_UNCHECKED)
EndIf
Case $button2
_GUICtrlButton_SetCheck($Radio1, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio2, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio3, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio4, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio5, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio6, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio7, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio8, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio9, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio10, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio11, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio12, $BST_CHECKED)
_GUICtrlButton_SetCheck($Radio13, $BST_CHECKED)
Case $button3
_GUICtrlButton_SetCheck($Radio1, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio2, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio3, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio4, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio5, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio6, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio7, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio8, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio9, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio10, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio11, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio12, $BST_UNCHECKED)
_GUICtrlButton_SetCheck($Radio13, $BST_UNCHECKED)
EndSwitch
WEnd
Case $Btn2
exit
EndSwitch
WEnd