Sign in to follow this  
Followers 0
TuMiM

progressbar for a runwait

11 posts in this topic

Is there a way to make a progress bar that is not by percentage. One that will just keep running until a runwait completes?

Case $msg = $Button1
               ProgressOn("test", "test")
    Runwait("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE)
        ProgressOff()

Share this post


Link to post
Share on other sites



Is there a way to make a progress bar that is not by percentage. One that will just keep running until a runwait completes?

Case $msg = $Button1
               ProgressOn("test", "test")
    Runwait("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE)
        ProgressOff()

might try a run command,

i.e. $PID = Run("your command")

While $PID

Sleep ( 1000 )

;ProgressSet command

$PID = ProcessExists($PID)

Wend


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

might try a run command,

i.e. $PID = Run("your command")

While $PID

Sleep ( 1000 )

;ProgressSet command

$PID = ProcessExists($PID)

Wend

What would the progressset command be for that?

Share this post


Link to post
Share on other sites

What would the progressset command be for that?

ProgressOn("test", "test")
        $PID = Run("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE)
        While $PID
        Sleep ( 1000 )

        ProgressSet($pid)

        $PID = ProcessExists($PID)
        Wend

        
        ProgressOff()

The above doesn't do anything in the progress bar. It just stays empty. I know i am doign something wrong. What?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

ProgressOn("test", "test")
        $PID = Run("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE)
        While $PID
        Sleep ( 1000 )

        ProgressSet($pid)

        $PID = ProcessExists($PID)
        Wend

        
        ProgressOff()

The above doesn't do anything in the progress bar. It just stays empty. I know i am doign something wrong. What?

ProgressOn("test", "test")
$PID = Run("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix", "", @SW_HIDE)
$x = 0
$Forward = 1
While 1
    Sleep(200)
    If $Forward Then
        If $x < 100 Then
            $x = $x + 10
        Else
            $Forward = 0
        EndIf
    Else
        If $x > 0 Then
            $x = $x - 10
        Else
            $Forward = 1
        EndIf
    EndIf
    ProgressSet($x)
    
    $PID = ProcessExists($PID)
WEnd


ProgressOff()
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

ProgressOn("test", "test")
        $PID = Run("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE)
        While $PID
        Sleep ( 1000 )

        ProgressSet($pid)

        $PID = ProcessExists($PID)
        Wend

        
        ProgressOff()

The above doesn't do anything in the progress bar. It just stays empty. I know i am doign something wrong. What?

Can anyone help me out here?

Share this post


Link to post
Share on other sites

Can anyone help me out here?

look at my example

yours just keeps setting the percent to the pid


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

ok. I see your code but it just keeps going. It never stops when the process is complete.

Share this post


Link to post
Share on other sites

try:

While ProcessExists($PID)
    Sleep(200)
    If $Forward Then
        If $x < 100 Then
            $x = $x + 10
        Else
            $Forward = 0
        EndIf
    Else
        If $x > 0 Then
            $x = $x - 10
        Else
            $Forward = 1
        EndIf
    EndIf
    ProgressSet($x)
WEnd

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thank you. That is great! Just one more thing. How do you embed a progress bar in a gui if possible?

Share this post


Link to post
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
Sign in to follow this  
Followers 0