Jump to content

Recommended Posts

Posted

Hi,

From time to time I have a bunch of scripts or executables that I need to run in a certain order. Thus I was thinking Runwait is a good way to control the order in which things run, but I was thinking that a progress bar might be helpful for users. Thus should I just place marquee in place or does someone have advice on how to link the progress bar to the various Runwaits?

Thanks

Posted (edited)

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>

$ProgramCount = 5 ; The ammount of programs you're gonna open

GUICreate("RunWait Progress Bar", 220, 100, 100, 200, 0, $WS_EX_TOPMOST) ; Create GUI
GUISetState(@SW_SHOW) ; Show it
$ProgressBar = GUICtrlCreateProgress(10, 10, 200, 20) ; Create Bar
GUICtrlSetData($ProgressBar, 0) ; Set your Progress Bar to 0% completed

RunWait("Notepad.exe", @WindowsDir, @SW_MAXIMIZE) ; Run first process
GUICtrlSetData($ProgressBar, GUICtrlRead($ProgressBar) + (100 / $ProgramCount)) ; Add 20% to the bar

RunWait("Explorer.exe", @WindowsDir, @SW_MAXIMIZE) ; Run second process
GUICtrlSetData($ProgressBar, GUICtrlRead($ProgressBar) + (100 / $ProgramCount)) ; Add 20% to the bar

RunWait("A.exe", @WindowsDir, @SW_MAXIMIZE) ; Run third process
GUICtrlSetData($ProgressBar, GUICtrlRead($ProgressBar) + (100 / $ProgramCount)) ; Add 20% to the bar

RunWait("B.exe", @WindowsDir, @SW_MAXIMIZE) ; Run fourth process
GUICtrlSetData($ProgressBar, GUICtrlRead($ProgressBar) + (100 / $ProgramCount)) ; Add 20% to the bar

RunWait("C.exe", @WindowsDir, @SW_MAXIMIZE) ; Run fifth process
GUICtrlSetData($ProgressBar, GUICtrlRead($ProgressBar) + (100 / $ProgramCount)) ; Add 20% to the bar

Edited by Demonic
Posted

Problem i find with using ProgressOn is it has a predefined count. maybe a function takes 50-70 sec to complete and that's on your computer but may take more or less time on another computer.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>

$Form1 = GUICreate("progress123", 198, 19, 820, 512, BitOR($WS_SYSMENU,$WS_DLGFRAME,$WS_POPUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlCreateProgress(-1, -1, 200, 20, $PBS_MARQUEE)
_SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50)

GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

see if you can work with this.

ftc

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...