Creates a Progress control for the GUI.
GUICtrlCreateProgress ( left, top [, width [, height [, style = -1 [, exStyle = -1]]]] )
To obtain the value of the control see GUICtrlRead().
To set or change information in the control see GUICtrlUpdate...() functions.
To update the bar position just use GUICtrlSetData().
To combine styles with the default style use BitOR($GUI_SS_DEFAULT_PROGRESS, newstyle, ... ).
To use the values specified above you must #include <ProgressConstants.au3> in your script.
Default resizing is $GUI_DOCKAUTO size and position will occur.
GUICoordMode (Option), GUICtrlSetData, GUICtrlUpdate..., GUIGetMsg
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <ProgressConstants.au3>
Example()
Func Example()
GUICreate ("My GUI Progressbar",220,100,100,200)
Local $idProgress_bar1= GUICtrlCreateProgress (10,10,200,20)
GUICtrlSetColor (-1,32250); not working with Windows XP Style
Local $idProgress_bar2= GUICtrlCreateProgress (10,40,200,20,$PBS_SMOOTH)
Local $idButton= GUICtrlCreateButton ("Start",75,70,70,20)
GUISetState (@SW_SHOW )
Local $iWait= 20; wait 20ms for next progressstep
Local $iSavPos= 0; progressbar-saveposition
Local $idMsg,$idM
; Loop until the user exits.
Do
$idMsg= GUIGetMsg ()
If $idMsg= $idButtonThen
GUICtrlSetData ($idButton,"Stop")
For $i= $iSavPosTo 100
If GUICtrlRead ($idProgress_bar1)= 50Then MsgBox ($MB_SYSTEMMODAL,"Info","The half is done...",1)
$idM= GUIGetMsg ()
If $idM= $GUI_EVENT_CLOSEThen ExitLoop
If $idM= $idButtonThen
GUICtrlSetData ($idButton,"Next")
$iSavPos= $i;save the current bar-position to $iSavPos
ExitLoop
Else
$iSavPos= 0
GUICtrlSetData ($idProgress_bar1,$i)
GUICtrlSetData ($idProgress_bar2,(100- $i))
Sleep ($iWait)
EndIf
Next
If $i> 100Then
GUICtrlSetData ($idButton,"Start")
EndIf
EndIf
Until $idMsg= $GUI_EVENT_CLOSE
EndFunc ;==>Example