Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 303, 253, 192, 124)
$Progress1 = GUICtrlCreateProgress(24, 48, 250, 25)
$Button1 = GUICtrlCreateButton("Lancer", 24, 8, 250, 25)
$Progress2 = GUICtrlCreateProgress(24, 166, 250, 25)
$Button2 = GUICtrlCreateButton("Lancer", 24, 126, 250, 25)
$Label1 = GUICtrlCreateLabel("0", 136, 96, 100, 17)
$Craft1 = GUICtrlCreateLabel("0", 30, 96, 100, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x3399FF)
$Label2 = GUICtrlCreateLabel("0", 136, 205, 100, 17)
GUISetState(@SW_SHOW)
Global $ProgressBar1 = 0
Global $ProgressBar2 = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Btn1()
Case $Button2
_Btn2()
EndSwitch
If $ProgressBar1 = 100 Then
$ProgressBar1 = 0
AdlibUnRegister("_ProgressBar1")
GUICtrlSetData($Label1, $ProgressBar1)
GUICtrlSetData($Progress1, $ProgressBar1)
[color=#00BF00] Global $Resultat, $ch1 = Random(1,3,1)
$Resultat += $ch1
GUICtrlSetData($Craft1, $Resultat)[/color]
EndIf
If $ProgressBar2 = 100 Then
$ProgressBar2 = 0
AdlibUnRegister("_ProgressBar2")
GUICtrlSetData($Label2, $ProgressBar2)
GUICtrlSetData($Progress2, $ProgressBar2)
EndIf
WEnd
Func _Btn1()
AdlibRegister("_ProgressBar1", 60)
EndFunc ;==>_Btn1
Func _Btn2()
AdlibRegister("_ProgressBar2", 60)
EndFunc ;==>_Btn2
Func _ProgressBar1()
$ProgressBar1 = $ProgressBar1 + 1
GUICtrlSetData($Label1, $ProgressBar1)
GUICtrlSetData($Progress1, $ProgressBar1)
EndFunc ;==>_ProgressBar1
Func _ProgressBar2()
$ProgressBar2 = $ProgressBar2 + 1
GUICtrlSetData($Label2, $ProgressBar2)
GUICtrlSetData($Progress2, $ProgressBar2)
EndFunc ;==>_ProgressBar2