Code : Tout sélectionner
; -------------------------------------------------------------------
; --------------------------- Section III ---------------------------
; -------------------------------------------------------------------
Opt("GUIOnEventMode", 1) ; Activation du mode événementiel
;Déclarations de variables
Global $var = 1
; -------------------------------------------------------------------
; ---------------------------- Section IV ---------------------------
; -------------------------------------------------------------------
; ########## FENETRE PRINCIPALE ##########
Global $GUIPrincipal = GUICreate("###", 1024, 740)
GUISetOnEvent($GUI_EVENT_CLOSE, "_OuvrirGUIFermerSession") ; Afficher la fenêtre Fermer une session
GUICtrlSetFont(-1, 10, 800, 0, "Trebuchet MS")
GUICtrlSetBkColor(-1, 0xD5D6D8)
; ########## BOUTON 1 ##########
If $var = IniRead($ConfigDir & $FichierINI, "ParametresBouton1", "Activer", "1") Then
$NomBtn1 = IniRead($ConfigDir & $FichierINI, "ParametresBouton1", "NomBouton", "")
$Icone1 = IniRead($ConfigDir & $FichierINI, "ParametresBouton1", "Icone", "")
$FullPath1 = IniRead($ConfigDir & $FichierINI, "ParametresBouton1", "FullPath", "")
Global $Pic1 = GUICtrlCreatePic($Icone1, 47, 202, 37, 37, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Btn1 = GUICtrlCreateButton($NomBtn1, 95, 200, 125, 41)
GUICtrlSetOnEvent($Btn1, "_OuvrirApplication1")
EndIf
; ########## BOUTON 2 ##########
If $var = IniRead($ConfigDir & $FichierINI, "ParametresBouton2", "Activer", "1") Then
$NomBtn2 = IniRead($ConfigDir & $FichierINI, "ParametresBouton2", "NomBouton", "")
$Icone2 = IniRead($ConfigDir & $FichierINI, "ParametresBouton2", "Icone", "")
$FullPath2 = IniRead($ConfigDir & $FichierINI, "ParametresBouton2", "FullPath", "")
Global $Pic2 = GUICtrlCreatePic($Icone2, 47, 277, 37, 37, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Btn2 = GUICtrlCreateButton($NomBtn2, 95, 275, 125, 41)
GUICtrlSetOnEvent($Btn2, "_OuvrirApplication2")
EndIf
; ########## BOUTON FERMER LA SESSION ##########
Global $BtnGUIFermerSession = GUICtrlCreateButton("Quitter", 863, 50, 125, 41)
GUICtrlSetOnEvent($BtnGUIFermerSession, "_OuvrirGUIFermerSession")
; ########## TITRE ##########
Global $Label1 = GUICtrlCreateLabel("###", 32, 32, 639, 41)
GUICtrlSetFont(-1, 22, 800, 0, "Trebuchet MS")
GUICtrlSetBkColor(-1, 0xD5D6D8)
; ########## FENETRE DE FERMETURE DE SESSION WINDOWS ##########
Global $GUIFermerSession = GUICreate("Quitter l'application", 300, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "_FermerFenetre")
Global $Label3 = GUICtrlCreateLabel("Voulez-vous vraiment quitter l'application ?", 0, 20, 300, 16, $SS_CENTER)
Global $BtnFermerSession = GUICtrlCreateButton("Oui", 40, 60, 100, 30)
GUICtrlSetOnEvent($BtnFermerSession, "_FermerSession")
Global $BtnFermerSessionAnnuler = GUICtrlCreateButton("Annuler", 160, 60, 100, 30)
GUICtrlSetOnEvent($BtnFermerSessionAnnuler, "_AnnulerFermerSession")
GUISetState(@SW_SHOW, $GUIPrincipal) ; Affiche GUIPrincipal
; -------------------------------------------------------------------
; ---------------------------- Section V ----------------------------
; -------------------------------------------------------------------
While 1 ; Début de la boucle infinie
Sleep(1000) ; Pause du script
WEnd ; Fin de la boucle infinie
; -------------------------------------------------------------------
; ---------------------------- Section VI ---------------------------
; -------------------------------------------------------------------
Func _OuvrirApplication1() ; Fonction Ouvrir l'application 1
Local $LabelChargement = GUICtrlCreateLabel("Chargement en cours...", 32, 700, 181, 26)
GUICtrlSetFont(-1, 12, 800, 2, "Trebuchet MS")
GUICtrlSetBkColor(-1, 0xFFFFFF)
Run($FullPath1)
Sleep(8000)
GUICtrlDelete($LabelChargement)
EndFunc ;==> Fin
Func _OuvrirApplication2() ; Fonction Ouvrir l'application 2
Local $LabelChargement = GUICtrlCreateLabel("Chargement en cours...", 32, 700, 181, 26)
GUICtrlSetFont(-1, 12, 800, 2, "Trebuchet MS")
GUICtrlSetBkColor(-1, 0xFFFFFF)
Run($FullPath2)
Sleep(8000)
GUICtrlDelete($LabelChargement)
EndFunc ;==> Fin
Func _OuvrirGUIFermerSession() ; Fonction Ouvrir le GUI de Fermeture de Session
GUISetState(@SW_HIDE, $GUIPrincipal)
GUISetState(@SW_SHOW, $GUIFermerSession)
EndFunc ;==> Fin
Func _AnnulerFermerSession() ; Fonction Annuler Fermer Session
GUISetState(@SW_HIDE, $GUIFermerSession)
GUISetState(@SW_SHOW, $GUIPrincipal)
EndFunc ;==> Fin
Func _FermerSession() ; Fonction Fermer Session
GUISetState(@SW_HIDE, $GUIFermerSession)
Sleep(200)
Shutdown(0)
Exit
EndFunc ;==> Fin
Func _FermerFenetre() ; Fermer une fenêtre
If @GUI_WINHANDLE = $GUIFermerSession Then
GUISetState(@SW_HIDE, $GUIFermerSession)
GUISetState(@SW_SHOW, $GUIPrincipal)
EndIf
EndFunc ;==> Fin