Need help with a Progress bar

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
audiofeinn
Posts: 28
Joined: 30 Jul 2016, 07:55

Need help with a Progress bar

06 Mar 2017, 03:09

Hey guys so here is my deal; I have a script that launches multiple functions that setup a computer position.

What I want is a progress bar that simply says how many apps are left and the name of the current function being run.

For the sake of clarity here is what it comes down too:

Code: Select all

;; Launcher App ;;

	;; Includes necessairy function files, this is normally donne with a config file that includes all the functions ;;
#include test_message1.ahk
#include test_message2.ahk
#include test_message3.ahk
#include ProgressBar.ahk

ProgressBar(3)
test_message1()
test_message2()
test_message3()
ExitApp
Here is an example of a function used, normally launches specific programs to specific XY location and declares a global AppName for the user.

Code: Select all

testmsg1(){
Global
AppName = "Basic Message Box 1" ; declares name so that i can be specified in the ProgressBar

Msgbox, , test1, test1, 3
}
And here is the Progression bar function:

Code: Select all

ProgressBar(FuncNum){

Loop
	{
	x:= 100 / FuncNum
	y:= x * A_Index
	z:= FuncNum - A_Index
	
	ProgressBar,,Number of Apps left: %z%, %AppName%
	Progress, %y%
	
	If A_Index=%FuncNum%
		Break
	}

Progress, Off

}

What I want is for the Progression bar to be visible while the functions are launching and to close when they are done.

Ideally this would work with a WinWait where the progressbar loop waits for the next function to end then loops. Any idea how I can make this happen?

It is very much a work in progress, any advice would be a huge help, thanks in advance!
User avatar
aztec3
Posts: 177
Joined: 07 Apr 2014, 12:05

Re: Need help with a Progress bar

06 Mar 2017, 08:17

Is there a reason you can't use:

Code: Select all

Progress, Off

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: adam86shadow, balawi28, Bing [Bot], Chunjee, Google [Bot], JKJadan and 264 guests