Avec AutoIt, on peux changer de ces barres de progression classiques. Il faut juste ajouter quelques lignes
- "Marquee" :
Pensez à vérifier l'OS avec un petit :
Code : Tout sélectionner
If @OSBuild < 6000
Code : Tout sélectionner
If @OSBuild < 6000
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Sh4dows", 480, 352, 219, 167)
$R = GUICtrlCreateProgress(16, 40, 449, 25)
$Label1 = GUICtrlCreateLabel("Rouge :", 16, 16, 49, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$J = GUICtrlCreateProgress(14, 107, 449, 25)
$Label2 = GUICtrlCreateLabel("Jaune :", 14, 83, 46, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$V = GUICtrlCreateProgress(16, 172, 449, 25)
$Label3 = GUICtrlCreateLabel("Vert", 16, 148, 27, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$S = GUICtrlCreateProgress(16, 255, 449, 25)
$Label4 = GUICtrlCreateLabel("Normale :", 16, 231, 58, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Start", 100, 320, 137, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Stop", 250, 320, 137, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_Progress_Start($R)
_Progress_Start($J)
_Progress_Start($V)
_Progress_Start($S)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_Progress_Start($R)
_Progress_Start($J)
_Progress_Start($V)
_Progress_Start($S)
EndSwitch
WEnd
Func _Progress_Start($ProgressBar)
If $ProgressBar <> $S Then
;(1 = Vert, 2 = Rouge, 3 = Jaune)
GUICtrlSetStyle($ProgressBar,0x040A)
_SendMessage(GUICtrlGetHandle($ProgressBar), 0x040A, True, 50)
If $ProgressBar = $R Then
;== Rouge ==
_SendMessage(GUICtrlGetHandle($ProgressBar),0x400 + 16, 2,0)
ElseIf $ProgressBar = $J Then
;== Jaune ==
_SendMessage(GUICtrlGetHandle($ProgressBar),0x400 + 16, 3,0)
ElseIf $ProgressBar = $V Then
;== Vert ==
_SendMessage(GUICtrlGetHandle($ProgressBar),0x400 + 16, 1,0)
EndIf
Else
For $i = 1 To 100
$Msg = GUIGetMsg()
If $Msg = $Button2 Then
_Progress_Stop($R)
_Progress_Stop($J)
_Progress_Stop($V)
GUICtrlSetData($ProgressBar, 0)
ExitLoop
EndIf
GUICtrlSetData($ProgressBar, $i)
Sleep(33)
Next
EndIf
EndFunc
Func _Progress_Stop($Progress)
GUICtrlSetStyle($Progress,0)
If $Progress = $R Then
;== Rouge ==
_SendMessage(GUICtrlGetHandle($Progress), 0x040A, False, 0)
ElseIf $Progress = $J Then
;== Jaune ==
_SendMessage(GUICtrlGetHandle($Progress), 0x040A, False, 0)
ElseIf $Progress = $V Then
;== Vert ==
_SendMessage(GUICtrlGetHandle($Progress), 0x040A, False, 0)
EndIf
EndFunc
Code : Tout sélectionner
#include <GUIConstantsEx.au3>
#include <SendMessage.au3>
GUICreate("GUI", 268, 107, 387, 31)
$Progress1 = GUICtrlCreateProgress(8, 8, 254, 17)
$Progress2 = GUICtrlCreateProgress(8, 32, 254, 17)
$Progress3 = GUICtrlCreateProgress(8, 56, 254, 17)
$Progress4 = GUICtrlCreateProgress(8, 80, 254, 17)
GUICtrlSetData($Progress1, 50)
_SendMessage(GUICtrlGetHandle($Progress1),0x400 + 16,1,0)
GUICtrlSetData($Progress2, 50)
_SendMessage(GUICtrlGetHandle($Progress2),0x400 + 16,2,0)
GUICtrlSetData($Progress3, 50)
_SendMessage(GUICtrlGetHandle($Progress3),0x400 + 16,3,0)
GUICtrlSetStyle($Progress4,0x040A)
_SendMessage(GUICtrlGetHandle($Progress4), 0x040A, True, 50)
GUISetState(@SW_SHOW)
While 1
Sleep(1000)
WEnd
GELDROC a écrit :ce que @DJSIR voulais surement vous dire est que
on crée au départ une Bar en Vert puis ci ils y a une erreur ou autre EX:(un téléchargement) on la mes en rouge puis on arrête le téléchargement.