Double Progress Bar

Recommended Posts

ss3vegeta 0

ss3vegeta 0

I've created a small program that installs a list of user selected software. The program works, but it takes a very long time for some of the software to install. So people think that it is frozen when in fact it isn't.

What I'm wondering is if there is a way to create a double progress bar in the same window. Basically the top one just being a constant scan so that the program doesn't look like it's frozen and the bottom one tracking the progress of the programs installed, like the current one does. By constant scan I simply mean that the top one just slides from left to right every few seconds so there is some movement and people don't complain that the program is frozen.

Share this post

Link to post

Share on other sites

DangerousDan 1

DangerousDan 1

can you increment the "current" bar during a file operation (filecopy) depending on how much of the operation has progressed or will it increment in a certain period of time? I'm still not sure how these work...

Share this post

Link to post

Share on other sites

ss3vegeta 0

ss3vegeta 0

WoW! Thanks for all the responses. I went with GDIpProgress.au3 include that I found on the forum. I think it turned out pretty nicely.

Func InstallAndDisplayProgress($arraySize,$installFlag,$arrInstallKey)$loop=0$ProgressFlag=0$Gui=GUICreate("Installing Software",350,175,-1,-1,$GUI_SS_DEFAULT_GUI,$WS_EX_TOPMOST)$installMessage=GUICtrlCreateLabel("This may take a very long time!",$guiBorder*2,$guiBorder,310,25,$SS_CENTER+$SS_CENTERIMAGE)GUICtrlSetFont($installMessage,9,800,0,"Arial")GUICtrlSetColor($installMessage,0xFFFFFF)$installMessage2=GUICtrlCreateLabel("Installation Progress",$guiBorder*2,$guiBorder*7.5,310,25,$SS_CENTER+$SS_CENTERIMAGE)GUICtrlSetFont($installMessage2,9,800,0,"Arial")GUICtrlSetColor($installMessage2,0xFFFFFF)$installMessage3=GUICtrlCreateLabel($ProgressFlag&" of "&$numberOfSoftwareSelected&" programs installed so far.",$guiBorder*2,$guiBorder*13,310,25,$SS_CENTER+$SS_CENTERIMAGE)GUICtrlSetFont($installMessage3,9,800,0,"Arial")GUICtrlSetColor($installMessage3,0xFFFFFF)$ProgressBar=_ProgressCreate($guiBorder,$guiBorder*10,330,30)_ProgressSetImages($ProgressBar,@ScriptDir&"\prgimgs\green.jpg",@ScriptDir&"\prgimgs\bg.jpg")$PMarquee=_ProgressCreate($guiBorder,$guiBorder*4,330,30)_ProgressSetImages($PMarquee,@ScriptDir&"\prgimgs\marquee.jpg",@ScriptDir&"\prgimgs\bg.jpg")_ProgressMarquee($PMarquee,1,0)GUISetCursor(0)GUISetFont(8,800,0,"Arial")GUISetBkColor(0x292929)GUISetState(@SW_SHOW)While$loop<$arraySizeIf$programs[$loop][$arrInstallKey]=$installFlagThenRunWait("Installers/"&$programs[$loop][$arrFileName])$ProgressFlag=$ProgressFlag+1_ProgressSet($ProgressBar,Ceiling(($ProgressFlag/$numberOfSoftwareSelected)*100))_ProgressSetText($ProgressBar,"Install "&Ceiling(($ProgressFlag/$numberOfSoftwareSelected)*100)&"%")If$ProgressFlag=$numberOfSoftwareSelectedThenGUICtrlSetData($installMessage3,"Installation Complete!")ElseGUICtrlSetData($installMessage3,$ProgressFlag&" of "&$numberOfSoftwareSelected&" programs installed so far.")EndIfEndIf$loop=$loop+1WEndSleep(5000)_GDIPlus_Shutdown()GUIDelete($Gui)EndFunc