Archive: Marquee Style Progress Bar


Marquee Style Progress Bar
Is it possible to make a progress bar has "floating" value like this one:
http://img136.imagevenue.com/loc400/..._122_400lo.jpg

I tried this code

Function SetMarquee
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $HWNDPARENT 1004
IntOp $1 ${WM_USER} + 10
SendMessage $0 $1 1 200 $2
FunctionEnd


WM_USER + 10 is the same as PBS_SETMARQUEE,the message to set a progress bar to marquee mode,but it didn't work.Does anybody know how to do it?
Thank you for the attention

There are two problems in your code.

  1. The progress bar doesn't have the PBS_MARQUEE style.
  2. You passed $HWNDPARENT to GetDlgItem instead of $0.
So, fix those two and you get:
Function SetMarquee
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1004
System::Call user32::GetWindowLong(ir0,i-16)i.r1
IntOp $1 $1 | 8 # PBS_MARQUEE
System::Call user32::SetWindowLong(ir0,i-16,ir1)
IntOp $1 ${WM_USER} + 10
SendMessage $0 $1 1 200 $2
FunctionEnd

Is it possible to make the marquee a little bit smoother? The progress sometimes runs faster and suddenly it is slower.


Just to clarify...[list=1][*]XPStyle must be set to on[*]Use 0x400 in place of ${WM_USER} to remove dependency[*]To remove the Marquee effect just XOr instead of Or[/list=1]

Here is my version as a macro I'm using during installation of third party software when the installation time is unknown.

!define SetMarquee `!insertmacro PBS_MARQUEE |`
!define RemMarquee `!insertmacro PBS_MARQUEE ^`

!macro PBS_MARQUEE PBS_MARQUEE_OP
    Push $0
    Push $1
    Push $2
    FindWindow $0 "#32770" "" $HWNDPARENT
    GetDlgItem $0 $0 1004
    System::Call user32::GetWindowLong(ir0,i-16)i.r1
    IntOp $1 $1 ${PBS_MARQUEE_OP} 8 # PBS_MARQUEE = 8
    System::Call user32::SetWindowLong(ir0,i-16,ir1)
    IntOp $1 0x400 + 10 # ${WM_USER} = 0x400
    SendMessage $0 $1 1 200 $2
    Pop $2
    Pop $1
    Pop $0
!macroend


is there a way to set the marquee speed?

i found this http://msdn.microsoft.com/de-de/libr...=vs.80%29.aspx

but i dont know how to use that in nsis :/


Originally posted by Masternoob
is there a way to set the marquee speed?

i found this http://msdn.microsoft.com/de-de/libr...=vs.80%29.aspx

but i dont know how to use that in nsis :/
That is .NET stuff, you need to send PBM_SETMARQUEE