Sign in to follow this  
Followers 0
GaryFrost

Marque Progress bar

9 posts in this topic

#include <GUIConstants.au3>

Const $PBS_MARQUEE = 0x08 

GUICreate("My GUI Marque Bar",220,100, 100,200)
GUICtrlSetColor(-1,32250); not working with Windows XP Style
$MarqueBar = GUICtrlCreateProgress (0,80,220,20,$PBS_MARQUEE)
$start = GUICtrlCreateButton ("Start",75,25,70,20)
$stop = GUICtrlCreateButton ("Stop",75,50,70,20)
GUISetState ()


Global $i = 0

do
    $msg = GUIGetMsg()
    Select
        Case $msg = $start
            $i = 0
            $stage = 1
            _SetBarColor($MarqueBar,0x0000FF)
            AdlibEnable("Marque",100)
        Case $msg = $stop
            AdlibDisable()
    EndSelect
until $msg = $GUI_EVENT_CLOSE

Func _SetBarColor($h_wnd, $i_ColorRef)
    Const $WM_USER = 0x400
    Const $PBM_SETBARCOLOR = ($WM_USER+9)
    GUICtrlSendMsg($h_wnd, $PBM_SETBARCOLOR, 0, Int($i_ColorRef))
EndFunc

Func Marque()
    If $i >= 33 And $i <= 66 And $stage == 1 Then 
        _SetBarColor($MarqueBar,0xFFFFFF)
        $stage = 2
    ElseIf $i > 66 and $stage = 2 Then 
        _SetBarColor($MarqueBar,0xA00000)
        $stage = 3
    ElseIf $i >= 100 Then
        _SetBarColor($MarqueBar,0x0000FF)
        $stage = 1
        $i = 0
    EndIf
    $i += 1
    GUICtrlSetData ($MarqueBar,(100 - $i))
EndFunc


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



This is great! I've always wondered how I would make this kind of porgress bar... Like when windows starts up :( Good work, me like! : Oh yea, it also requires latest BETA :(


FootbaG

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This is great! I've always wondered how I would make this kind of porgress bar... Like when windows starts up :( Good work, me like! : Oh yea, it also requires latest BETA :(

<{POST_SNAPBACK}>

Why would it require latest beta?

Both the GUICtrlCreateProgress and GUICtrlSendMsg exist in current release.

Would just need to change 1 line of code $i += 1 to $i = $i + 1

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

#4 ·  Posted (edited)

Only works on Windows XP Style Theme or Classic. Doesn't work on any of my 'Windows Blind's' Theme.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Very nice script. But why you use custom _SetBarColor instead internal GUICtrlSetColor?

<{POST_SNAPBACK}>

I was just messing around with progressbar messages.

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

This progress bar works fine on XP, but I am unable to get it working on NT the way it works on XP. Anyone have any ideas? I like the way the progress bar runs on XP.

Share this post


Link to post
Share on other sites

This progress bar works fine on XP, but I am unable to get it working on NT the way it works on XP. Anyone have any ideas? I like the way the progress bar runs on XP.

<{POST_SNAPBACK}>

PBS_MARQUEE is style that first appears only in the version 6 of comctl32.dll - in the XP. Not sure that you can use it on the prior OS verions.

Share this post


Link to post
Share on other sites

PBS_MARQUEE

Version 6.0 or later. The progress bar moves like a marquee.

Note Comctl32.dll version 6 is not redistributable but it is included in Microsoft Windows XP or later.

Gary


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

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