Jump to content

Progress Bar


hohner
 Share

Recommended Posts

Hi,

I'm trying to create a progress bar that will display the progress of several functions as they complete. Each function is actually an individual program installation which will install silently and unattended. My problem is that I'm not too sure where to put the GUICtrlSetData code for the progress bar. I want it to be updated after each app is installed.

If $msg = $RUN Then
    GUISetState (@SW_HIDE);hides the previous window where desired programs are selected

    GUICreate ("Software Setup - Progress", 400, 100);create the progress bar window
    $progress_bar = GUICtrlCreateProgress (25, 40, 350, 15)
    GUISetState (@SW_SHOW)
    $j = 100/$chkboxqty ;Progress division, ie- 2 programs = 50, 5 programs = 20 etc
                                      ;(each time a program is installed it should increase the progress by this division)
EndIf

;Find status of Chkbox
IF $status1 = 1 then call ("APP_1")
IF $status2 = 1 then call ("APP_2")
IF $status3 = 1 then call ("APP_3")

Func APP_1();Function for application 1
    RunWait ($drive&"myapp.exe")
EndFunc

Func APP_2();Function for application 2
    RunWait ($drive&"myapp.exe")
EndFunc

Func APP_3();Function for application 3
    RunWait ($drive&"myapp.exe")
EndFunc
Link to comment
Share on other sites

Put it inside functions.. just after RunWait..When it will be done.. progress bar will be updated.

Thanks for your help, I've finally got it working.

I declared $chkboxqty at the beginning of my code to be a value of zero.

Then I added this code to each app....

Func APP_1();Function for application 1
    RunWait ($drive&"myapp.exe")
    $x = GUICtrlRead ($progress_bar)
    $j = 100/$chkboxqty
    GUICtrlSetData ($progress_bar, $x + $j)
    sleep (2000)
EndFunc
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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