Jump to content
Sign in to follow this  
TuMiM

progressbar for a runwait

Recommended Posts

TuMiM

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
GaryFrost

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
TuMiM

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
TuMiM

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
GaryFrost

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
TuMiM

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
TuMiM

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
TuMiM

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
Jos

GUICtrlCreateProgress() will enabe you to create a progressbar in a GUI that is created in AutoIt3.


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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.