maxrealqnx Posted February 27, 2009 Share Posted February 27, 2009 (edited) CODE#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Progress1 = GUICtrlCreateProgress(152, 192, 150, 16) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd If you can help me very happy about it Edited February 27, 2009 by maxrealqnx Visit My Website Link to comment Share on other sites More sharing options...
Authenticity Posted February 27, 2009 Share Posted February 27, 2009 You're not setting or changing any state or data related to the ProgressBar control. Read the GUICtrlSetData function in the help file. Link to comment Share on other sites More sharing options...
Zedna Posted February 27, 2009 Share Posted February 27, 2009 #include <GUIConstants.au3> GUICreate("Test",220,100);, -1,-1, $WS_CAPTION, $WS_EX_TOPMOST) $progressbar = GUICtrlCreateProgress (10,15,200,20,$PBS_SMOOTH) $procent = GUICtrlCreateLabel ('0 %', 10,40,200,20,$SS_CENTER) $start = GUICtrlCreateButton ("Start",35,68,70,22) $stop = GUICtrlCreateButton ("Stop",115,68,70,22) GUICtrlSetState($stop,$GUI_DISABLE) GUISetState() $run = 0 $i = 0 While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $start Then $run = 1 GUICtrlSetState($start,$GUI_DISABLE) GUICtrlSetState($stop,$GUI_ENABLE) EndIf If $msg = $stop Then $run = 0 GUICtrlSetState($start,$GUI_ENABLE) GUICtrlSetState($stop,$GUI_DISABLE) EndIf If $run Then $i = $i + 1 If $i > 100 Then $i = 0 GUICtrlSetData ($progressbar,$i) GUICtrlSetData ($procent,$i & ' %') Sleep(100) EndIf Wend Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 27, 2009 Moderators Share Posted February 27, 2009 maxrealqnx, What do you want the progress bar to measure? There is nothing in your script to tell the progress bar to do anything. Look at this:#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Progress1 = GUICtrlCreateProgress(152, 192, 150, 16) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $inc = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $inc += .1 GUICtrlSetData($Progress1, $inc) WEnd You need to tell the progress bar what to display - it cannot read your mind! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 27, 2009 Author Share Posted February 27, 2009 You're not setting or changing any state or data related to the ProgressBar control.Read the GUICtrlSetData function in the help file.Okey, but I am very beginner Please, you give me an example.Regards. Visit My Website Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 27, 2009 Author Share Posted February 27, 2009 maxrealqnx, What do you want the progress bar to measure? There is nothing in your script to tell the progress bar to do anything. Look at this:#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Progress1 = GUICtrlCreateProgress(152, 192, 150, 16) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $inc = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $inc += .1 GUICtrlSetData($Progress1, $inc) WEnd You need to tell the progress bar what to display - it cannot read your mind! M23 I'm thank you very much for nice codes. how we can provide the progress bar to continuous repeat ? Visit My Website Link to comment Share on other sites More sharing options...
Authenticity Posted February 27, 2009 Share Posted February 27, 2009 Like Vista's? Anyway, use AVI control instead and play the control while there is a progress and stop it when processing is done. Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 27, 2009 Author Share Posted February 27, 2009 Like Vista's?Anyway, use AVI control instead and play the control while there is a progress and stop it when processing is done.I'd do it but I want to learn this method Visit My Website Link to comment Share on other sites More sharing options...
Authenticity Posted February 27, 2009 Share Posted February 27, 2009 (edited) #include <ProgressConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate('', 180, 100, 300, 400, $WS_POPUP, $WS_EX_TOOLWINDOW) $PrgBar = GUICtrlCreateProgress(0, 35, 180, 25, $PBS_MARQUEE) GUISetState() $Init = TimerInit() Do GUICtrlSetData($PrgBar, 0) Sleep(50) Until TimerDiff($Init) > 5000 GUIDelete($hGUI) Exit Well, my poor computer show it like a truncated blue snake, also because of the optimization for performance so visualization looks quite ugly to me but maybe it'll look green and shiny like Vista's on yours. Edited February 27, 2009 by Authenticity Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 27, 2009 Author Share Posted February 27, 2009 #include <ProgressConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate('', 180, 100, 300, 400, $WS_POPUP, $WS_EX_TOOLWINDOW) $PrgBar = GUICtrlCreateProgress(0, 35, 180, 25, $PBS_MARQUEE) GUISetState() $Init = TimerInit() Do GUICtrlSetData($PrgBar, 0) Sleep(50) Until TimerDiff($Init) > 5000 GUIDelete($hGUI) Exit Well, my poor computer show it like a truncated blue snake, also because of the optimization for performance so visualization looks quite ugly to me but maybe it'll look green and shiny like Vista's on yours. Hmmm Like this CODE#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Progressbar = GUICtrlCreateProgress(152, 192, 150, 16) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $run = 0 $i = 0 While 1 $nMsg = GUIGetMsg() $run = 1 If $run Then $i = $i + 1 If $i > 100 Then $i = 0 GUICtrlSetData ($progressbar,$i) Sleep(100) EndIf Wend Visit My Website Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 28, 2009 Author Share Posted February 28, 2009 (edited) Why the progress bar isn't working at same time with the RunWait("mspaint.exe") command ?CODE#include <GUIConstantsEx.au3>#include <ProgressConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Form1", 633, 454, 192, 114)$Progressbar = GUICtrlCreateProgress(152, 192, 150, 16)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###$run = 0$i = 0While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then ExitLoop If $i = 0 Then $run = 1 EndIf If $run Then $i = $i + 1 If $i > 100 Then $i = 0 EndIf GUICtrlSetData ($progressbar,$i) Sleep(100) RunWait("mspaint.exe") ;ExitWend Edited February 28, 2009 by maxrealqnx Visit My Website Link to comment Share on other sites More sharing options...
Developers Jos Posted February 28, 2009 Developers Share Posted February 28, 2009 (edited) Why the progress bar isn't working at same time with the RunWait("mspaint.exe") command ?No need to bold your text like this.RunWait() is a blocking function. When you want to do other things during the execution of a program you need to use Run().Jos Edited February 28, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BrettF Posted February 28, 2009 Share Posted February 28, 2009 No need for that text... Try something like this where the run is: $iPid = Run ("somefile.exe") While ProcessExists ($iPid) $i = $i + 1 If $i > 100 Then $i = 0 GUICtrlSetData ($progressbar,$i) WEnd *Untested* Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
toxicvn Posted February 28, 2009 Share Posted February 28, 2009 because : RunWait("mspaint.exe") Runs an external program and pauses script execution until the program finishes. then a will repeat loop Link to comment Share on other sites More sharing options...
maxrealqnx Posted February 28, 2009 Author Share Posted February 28, 2009 (edited) because : RunWait("mspaint.exe")Runs an external program and pauses script execution until the program finishes.then a will repeat loopNamely, do not run at the same time ? CODE#include <GUIConstantsEx.au3>#include <ProgressConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Form1", 633, 454, 192, 114)$Progressbar = GUICtrlCreateProgress(152, 192, 150, 16)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###$run = 0$i = 0RunWait("mspaint.exe")While 1$nMsg = GUIGetMsg()If $nMsg = $GUI_EVENT_CLOSE Then ExitLoopIf $i = 0 Then $run = 1 EndIfIf $run Then$i = $i + 1If $i > 100 Then $i = 0 RunWait("Notepad.exe")EndIfGUICtrlSetData ($progressbar,$i)Sleep(100);ExitWEnd Edited February 28, 2009 by maxrealqnx Visit My Website Link to comment Share on other sites More sharing options...
Developers Jos Posted February 28, 2009 Developers Share Posted February 28, 2009 Namely, do not run at the same time ? I assume that English isn't your native language (like for me), but the 3 answers to your question all state that RunWait() stops the script.Use Run() ! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now