
Une fois n'est pas coutume je bug sur un petit problème...
Dans le code ci-dessous, je lance un chronomètre dans la GUI en cliquant sur le bouton 1, jusque là tout va bien !
Ce que je n'arrive pas à faire c'est quitter/fermer la GUI en cliquant sur le bouton 2 si possible.
je ne vois pas trop comment faire donc votre aide sera la bienvenue.
Merci d'avance

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#Region ### START Koda GUI section ### Form=Form3.kxf
Dim $Ver = "Durée de l'appel"
$Form1 = GUICreate("Tel' Stats", 329, 249, 298, 189)
$MenuItem1 = GUICtrlCreateMenu("Réglages")
$MenuItem2 = GUICtrlCreateMenuItem("Ajouter un service", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Ajouter un agent", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Ajouter un commentaire", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("Visualiser le rapport d'activité", $MenuItem1)
GUISetBkColor(0xFFFFFF)
$Button1 = GUICtrlCreateButton("Button1", 8, 56, 80, 80, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir &"\IMG\on.bmp", -1)
$Button2 = GUICtrlCreateButton("Button2", 240, 56, 80, 80, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir &"\IMG\off.bmp", -1)
$Combo1 = GUICtrlCreateCombo("SERVICE", 112, 88, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$AGENT = GUICtrlCreateCombo("AGENT", 112, 112, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Combo3 = GUICtrlCreateCombo("RAISON DE L'APPEL", 8, 152, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Pic1 = GUICtrlCreatePic(@ScriptDir &"\IMG\1.jpg", 8, 184, 90, 35)
$Pic2 = GUICtrlCreatePic(@ScriptDir &"\IMG\2.jpg", 248, 184, 70, 41)
$Pic3 = GUICtrlCreatePic(@ScriptDir &"\IMG\3.JPG", 24, 16, 277, 28)
$Label1 = GUICtrlCreateLabel( $Ver, 120, 60, 100 )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button1
_Chrono()
Case $msg = $Button2
_Exit()
EndSelect
WEnd
Func _Chrono()
For $i = 0 To 86400; max. 24h
$Time = _DateAdd ( "s", $i, "2000/01/01 00:00:00" )
$Dif = StringSplit ( $Time, " " )
GUICtrlSetData ( $Label1, $Dif[2] )
Sleep( 1000 )
Next
Exit
EndFunc
Func _Exit()
Exit
EndFunc
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#Region ### START Koda GUI section ### Form=Form3.kxf
Dim $Ver = "Durée de l'appel"
$Form1 = GUICreate("Tel' Stats", 329, 249, 298, 189)
$MenuItem1 = GUICtrlCreateMenu("Réglages")
$MenuItem2 = GUICtrlCreateMenuItem("Ajouter un service", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Ajouter un agent", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Ajouter un commentaire", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("Visualiser le rapport d'activité", $MenuItem1)
GUISetBkColor(0xFFFFFF)
$Button1 = GUICtrlCreateButton("Button1", 8, 56, 80, 80, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir &"\IMG\on.bmp", -1)
$Button2 = GUICtrlCreateButton("Button2", 240, 56, 80, 80, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir &"\IMG\off.bmp", -1)
$Combo1 = GUICtrlCreateCombo("SERVICE", 112, 88, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$AGENT = GUICtrlCreateCombo("AGENT", 112, 112, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Combo3 = GUICtrlCreateCombo("RAISON DE L'APPEL", 8, 152, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Pic1 = GUICtrlCreatePic(@ScriptDir &"\IMG\1.jpg", 8, 184, 90, 35)
$Pic2 = GUICtrlCreatePic(@ScriptDir &"\IMG\2.jpg", 248, 184, 70, 41)
$Pic3 = GUICtrlCreatePic(@ScriptDir &"\IMG\3.JPG", 24, 16, 277, 28)
$Label1 = GUICtrlCreateLabel( $Ver, 120, 60, 100 )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button1
_Chrono()
Case $msg = $Button2
_Exit()
EndSelect
WEnd
Func _Chrono()
For $i = 0 To 86400; max. 24h
$Time = _DateAdd ( "s", $i, "2000/01/01 00:00:00" )
$Dif = StringSplit ( $Time, " " )
GUICtrlSetData ( $Label1, $Dif[2] )
Sleep( 1000 )
Next
Exit
EndFunc
Func _Exit()
Exit
EndFunc