#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> ; GUICreate("My GUI Progressbar", 220, 100, 100, 200) $ProgressBar = GUICtrlCreateProgress(10, 10, 200, 20) GUICtrlSetColor(-1, 32250); not working with Windows XP Style $Button = GUICtrlCreateButton("Start", 75, 70, 70, 20) GUISetState() $iWait = 20 ;Wait 20ms for next progressstep $iPos = 0 ;Progressbar-saveposition While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button GUICtrlSetData($Button, "Stop") $iPID = Run("Notepad.exe") While ProcessExists($iPID) $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then ExitLoop 2 If $nMsg = $Button Then GUICtrlSetData($Button, "Next") ExitLoop EndIf $iPos += 1 GUICtrlSetData($ProgressBar, $iPos) Sleep($iWait) If $iPos > 100 Then $iPos = 0 WEnd GUICtrlSetData($ProgressBar, 0) GUICtrlSetData($Button, "Start") EndSwitch WEnd |