Erlend Posted November 14, 2009 Posted November 14, 2009 Hello, i have created i samll app that runs an external command to collect data from 100+ servers, my problem with the progres bare is that the external command uses a diferent amount of time etatch time, part of the code: ProgressOn("APPx1", "collecting server info...", "99 percent") For $i = 95 to 100 step 99 sleep(1000) ProgressSet( $i, $i & " percent") RunWait(@COMSPEC &" /C " & $TSTool & " " & $user & " > z:\user.txt", @HomeDrive, @SW_HIDE) Next ProgressSet(100 , "Completed", "server info collected") sleep(500) ProgressOff() as you can se the external command tuns in the midle of the progress bar, i have now set it to start at 95% if it,s any help i can use a ProcessWaitClose to check if the external comand is completed. How can i make the progres bare just run as long as the external command takes to complete, and the go to 100%? Thanks for any help
Moderators Melba23 Posted November 14, 2009 Moderators Posted November 14, 2009 Erlend, I cannot help with timing your external app, but I can offer a "marquee" progress bar that at least shows something is happening: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I hope that helps. 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
Erlend Posted November 14, 2009 Author Posted November 14, 2009 Thanks for a very fast reply , should i just add the external command before creating the stand alone GUI?, i have looked at this as an solution, but i have'n tryed it.
Moderators Melba23 Posted November 14, 2009 Moderators Posted November 14, 2009 Erlend,You create the marquee progress just before you start your external app and let it run until your app finishes (i.e. the RunWait returns) - then you can delete it. All it does is give the indication that something is happening. I use it a lot when I have no way of telling how long something will take.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
Erlend Posted November 14, 2009 Author Posted November 14, 2009 thanks agian, i have now tried diferent combination, but i cant figure out when to start the RunWait command and when to creat the GUI: $hGUI = GUICreate("server - collecting information", 420, 40) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE RunWait(@COMSPEC &" /C " & $TSTool & " " & $user & " > u:\user.txt", @HomeDrive, @SW_HIDE) Exit EndSwitch WEnd where hould i put the RunWait command?
Moderators Melba23 Posted November 14, 2009 Moderators Posted November 14, 2009 Erlend,$hGUI = GUICreate("server - collecting information", 420, 40) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() RunWait(@COMSPEC &" /C " & $TSTool & " " & $user & " > u:\user.txt", @HomeDrive, @SW_HIDE) GUIDelete($hGUI)No need for a loop - the RunWait will keep the script open until it returns.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
Moderators Melba23 Posted November 14, 2009 Moderators Posted November 14, 2009 Erlend, Glad I could help. 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
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