Jump to content

Recommended Posts

Posted

I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process.

Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again.

In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it.

Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL?

Thanks in advance!

Posted

I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process.

Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again.

In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it.

Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL?

Thanks in advance!

You can create your own in a GUI. For example, you can use GUICtrlCreateLabel and create a square or squares. Then you can keep moving the squares to different spots, making it seem as if they are moving.
  • Moderators
Posted (edited)

I want to create an undetermined progress bar for the script I'm writing, because I don't know how long the process will take and I can't determine the current progress of the process.

Basically, an undetermined progress bar is a progress bar with a few blocks running from the left to the right (or vice-versa) of the bar, then going back again.

In Windows, you can find them when searching for files, or using a wizard that uses the web (webpublishing wizard, Passport-linking-wizard). You can also find them on Windows Update, when using the Custom mode. Or in Nero 7, when you insert a disc and Nero is analyzing it.

Back to the question: is this possible with AutoIt, using one of the functions or by loading a DLL?

Thanks in advance!

Let me just say that I'm very excited about figuring this one out on my own! What you are actually talking about is a marquee style progress bar. You have to set the control style to "PBS_MARQUEE", then send the "PBM_SETMARQUEE" message to the control.

You can find more info on this at MSDN.

Here is an example of working code:

#include <GUIConstants.au3>

Global Const $PBS_MARQUEE = 0x08
Global Const $WM_USER = 0x0400
Global Const $PBM_SETMARQUEE = ($WM_USER+10)

Global $status = 1

Opt("GUIOnEventMode", 1)

$GUI = GUICreate("Marquee Progress Bar", 200, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_CLOSE")

$GUI_Progress = GUICtrlCreateProgress(50, 25, 100, 20, $PBS_MARQUEE)
GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 1, 200)
$GUI_Button = GUICtrlCreateButton("Start/Stop", 70, 50)
GUICtrlSetOnEvent(-1, "Progress_Stop_Start")
GUISetState()

While 1 
    Sleep(100)
WEnd

Func Progress_Stop_Start()
    If $status Then
        GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 0, 200)
        $status = 0
    Else
        GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 1, 200)
        $status = 1
    EndIf
EndFunc

Func GUI_CLOSE()
    Exit
EndFunc
Edited by big_daddy
Posted (edited)

Let me just say that I'm very excited about figuring this one out on my own! What you are actually talking about is a marquee style progress bar. You have to set the control style to "PBS_MARQUEE", then send the "PBM_SETMARQUEE" message to the control.

You can find more info on this at MSDN.

I am very excited you figured this one out on your own too. I had no idea this could be done so easily. Methinks I shall be playing with this in the near future.

Edit: See below...

You forgot to put in the function for GUI_CLOSE()

Func GUI_CLOSE()
   Exit
EndFunc

Edited by SerialKiller
  • Moderators
Posted

@SerialKiller - Thanks I didn't scroll all the way down when I copied.

@Zenda - It requires version 6 of Comctl32.dll which is included in Microsoft Windows XP or later.

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
  • Recently Browsing   0 members

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