Archive: backgroundcolor in every Dialog


backgroundcolor in every Dialog
hi,
sorry for the newbie question, but i want to set the backgroundcolor in every Dialog. and i cant do that.
I read the manuel and try this one

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1006
SetCtlColors $0 0xFF0000 0x00FF00

in the oninit Sequence. But the Licence Page still the normal Windows Dialog Colors. I dont know howto use this.
Can Someone Help ? Or give me some example ?
Greets
Fred


For any of the dialogs/controls that don't conform, adjust the colors separately. Note that, depending on the control, this could be quite a few :)


Originally posted by Animaether
For any of the dialogs/controls that don't conform, adjust the colors separately. Note that, depending on the control, this could be quite a few :)
So know i can change the Color from the Header with
!define MUI_BGCOLOR "FF0000"
in the Example to red. Thats great ( for me ! )
But know i down know how to set the Color of the Text from the header :-(
And i alsaw doesnt know how i can change the Body Background Color. At this Time i try to change the Color from the Licence Page.
I realy dont know how :-(

You mean for the EULA text itself?

If so - I'm afraid you may be SOL there (would have to review some plugins or so). The richedit control used doesn't respect background color codes in the RTF file you'd feed it (the colors come from the RTF, so you can't set it with SetCtlColors).

If you mean any of the other bits...


!include "winmessages.nsh"
!include "MUI2.NSH"

BrandingText " "

!define MUI_LICENSEPAGE_TEXT_TOP "EULA Top Text"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "EULA Bottom Text"
; !define MUI_LICENSEPAGE_CHECKBOX
; !define MUI_LICENSEPAGE_CHECKBOX_TEXT "EULA Checkbox"

!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "EULA Accept"
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "EULA Decline"

!define MUI_PAGE_CUSTOMFUNCTION_PRE LicensePre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "eula.rtf"
; Page License LicensePre LicenseShow

Function LicensePre
!insertmacro MUI_HEADER_TEXT "This is the title" "This is the subtitle"
FunctionEnd

Function LicenseShow
SetCtlColors $HWNDPARENT 0x220000 0x000000 ; Main dialog

FindWindow $1 "#32770" "" $HWNDPARENT ; Inner dialog
SetCtlColors $1 0x440000 0x220000

GetDlgItem $0 $HWNDPARENT 0x40A ; MUI2 header background
SetCtlColors $0 0x660000 0x440000

GetDlgItem $0 $HWNDPARENT 0x40D ; MUI2 header title
SetCtlColors $0 0x880000 0x660000

GetDlgItem $0 $HWNDPARENT 0x40E ; MUI2 header subtitle
SetCtlColors $0 0xaa0000 0x880000

GetDlgItem $0 $HWNDPARENT 0x4E8 ; Branding Text
SendMessage $0 ${WM_SETTEXT} 0 "STR:Hello World"
SetCtlColors $0 0xcc0000 0xaa0000

GetDlgItem $0 $1 0x410 ; Text above eula
SetCtlColors $0 0x008800 0x006600

GetDlgItem $0 $1 0x3EE ; Text below eula
SetCtlColors $0 0x00aa00 0x008800

GetDlgItem $0 $1 0x40A ; Eula checkbox / Accept radiobutton
SetCtlColors $0 0x00cc00 0x00aa00

GetDlgItem $0 $1 0x40B ; Eula Decline radiobutton
SetCtlColors $0 0x00ee00 0x00cc00

GetDlgItem $0 $1 0x3E8 ; Eula body; can't change colors, they're defined by the Rich Text content.
; Note that the control used ignores background colors specified in the RTF - sorry :\

GetDlgItem $0 $HWNDPARENT 0x1 ; Close/Next Button
EnableWindow $0 1
SetCtlColors $0 0x0000aa 0x000088

GetDlgItem $0 $HWNDPARENT 0x2 ; Cancel Button
EnableWindow $0 1
SetCtlColors $0 0x0000cc 0x0000aa

GetDlgItem $0 $HWNDPARENT 0x3 ; Back Button
SendMessage $0 ${WM_SETTEXT} 0 "STR: Back"
ShowWindow $0 ${SW_SHOW}
EnableWindow $0 1
SetCtlColors $0 0x0000ee 0x0000cc
FunctionEnd

Outfile "test.exe"
Section
SectionEnd
!insertmacro MUI_LANGUAGE "English"


Note that with most windows styles, the button faces will mostly ignore the colors set (only the 'shaded' edges will get the colors).

presumably this might help...
http://msdn.microsoft.com/en-us/library/bb774228(VS.85).aspx
...but I can't get it to work.


hi thanks !
I try it ...