Archive: Progress Bar color or style


Progress Bar color or style
  Hello !!!!!

I am using UMUI interface. I want to change the color or style of Pogress bar on MUI_PAGE_INSTFILES page. How to do this?
I have tried this-----
!define MUI_INSTALLCOLORS "FF0000 00FF00"
!define MUI_INSTFILESPAGE_PROGRESSBAR "colored"

But it's not working. The error I am getting is-------
"MUI_INSTFILESPAGE_PROGRESSBAR already define" but I cheked that It is defined only one time. I am not getting why the error is comming?


Progress Bar Style
  Hello !!!!!

I am using UMUI interface. I want to change the color or style of Pogress bar on MUI_PAGE_INSTFILES page. How to do this?
I have tried this-----
!define MUI_INSTALLCOLORS "FF0000 00FF00"
!define MUI_INSTFILESPAGE_PROGRESSBAR "colored"

But it's not working. The error I am getting is-------
"MUI_INSTFILESPAGE_PROGRESSBAR already defined" but I cheked that It is defined only one time. I am not getting why the error is comming?

Please Help me how to do this


be sure to define those ABOVE the !insertmacro MUI_PAGE_INSTFILES command.


Hi Comm@nder21
I tried what you said.
!define MUI_INSTFILESPAGE_PROGRESSBAR "colored"
But the above statement give me same error as follows
"MUI_INSTFILESPAGE_PROGRESSBAR already defined" but I cheked that It is defined only one time. I am not getting why the error is comming?
After that I commented that Statement and I run the program with only one statement as follows-----
!define MUI_INSTALLCOLORS "FF0000 00FF00"
It does not give any error but it does not change the color of Progress Bar.
So can you give me some code or logic to do that?


I am having the same problem. What is the answer? Is something wrong with the following?

!define MUI_INSTFILESPAGE_PROGRESSBAR
!insertmacro MUI_PAGE_INSTFILES


Define it above the first page insertion.


I should have posted that I did finally figure it out, though it was not clear to me why this is required. Thanks for the confirmation, kichik!


I was having problems with this exact issue. Is there any way you can post what you have troubleshooted?

FYI:

This is what I'm currently working on troublshooting:

!include "WinMessages.nsh"
!include "MUI2.nsh"
!include "nsDialogs.nsh"

OutFile "test.exe"

Section
SectionEnd

Var dialog
Var hwnd
Var null

!define /math PBM_SETRANGE32 ${WM_USER} + 6

!define MUI_INSTFILESPAGE_PROGRESSBAR "color"
!define RED "0xD0A8A8"
/*!insertmacro MUI_PAGE_INSTFILES*/

Page Custom page.custom
Function page.custom
nsDialogs::Create 1018
Pop $dialog

${NSD_CreateProgressBar} 0 0 100% 15 "0xD0A8A8"
Pop $hwnd

${NSD_CreateTimer} NSD_Timer.Callback 10

nsDialogs::Show
FunctionEnd

/*Function ProgressBar.Color
!define RED "0xD0A8A8"
!define PINK "0x831618"
FunctionEnd*/

Function NSD_Timer.Callback
${NSD_KillTimer} NSD_Timer.Callback
SendMessage $hwnd ${PBM_SETRANGE32} 0 100

SendMessage $hwnd ${PBM_SETPOS} 1 0
Sleep 2000
SendMessage $hwnd ${PBM_SETPOS} 100 0
FunctionEnd

!insertmacro MUI_LANGUAGE "English"


@mvisual: try to set XPStyle off
XP themes force their own color on the progress bar.

Did you tried this? ::

!define MUI_INSTALLCOLORS "FF0000 00FF00"

>!define MUI_INSTFILESPAGE_PROGRESSBAR "colored"

Hi, I have the same problem.

I tried:

!include "LogicLib.nsh"
!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "Sections.nsh"
!include "WinMessages.nsh"

!define MUI_INSTALLCOLORS "000000 3F48CC"
!define MUI_INSTFILESPAGE_PROGRESSBAR colored

XPStyle off
Name "Progressbar"
OutFile "Progressbar.exe"
ShowInstDetails show

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES

Section Test
Sleep 100
SectionEnd


...but the progressbar is still green (Windows7) and green + XPStyle (WindowsXP)

How can I change the color? What is my mistake?
Please help

!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstShow
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

!define PBM_SETBARCOLOR 0x0409
!define PBM_SETBKCOLOR 0x2001

Function InstShow
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1004
System::Call UxTheme::SetWindowTheme(i,w,w)i(r0,"","")
SendMessage $0 ${PBM_SETBARCOLOR} 0 0x000000
SendMessage $0 ${PBM_SETBKCOLOR} 0 0x3F48CC
FunctionEnd


Thanks gfm688 for your answer!!! :)

I don't understand, why my code is wrong...but your code works excellent;)
Can you please explain the line to me?

System::Call UxTheme::SetWindowTheme(i,w,w)i(r0,"","")
What does (i,w,w)i(r0,"","") mean?
Is this line treated like a constant or can I change it?

Originally posted by C_10
Thanks gfm688 for your answer!!! :)

I don't understand, why my code is wrong...but your code works excellent;)
Can you please explain the line to me?

What does (i,w,w)i(r0,"","") mean?
Is this line treated like a constant or can I change it?
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx meaning, you can change the two empty strings (You don't want to, but you could :) )

OK :D
Thanks Anders