Archive: A few questions about SetBkColor


A few questions about SetBkColor
1. What is the color format for SetBkColor?
2.

Sets a background color for a static control, edit control, button or a dialog
Can we use it to paint the hole dialog? :D how?

PS1: Already attempting to paint the edit box
for the dir. installation, and it's working :up: .

PS2: I've been promoted as Major Dude :D :D

Like controls dialogs have a HWND too. For example, the outer dialog's HWND is $HWNDPARENT.


Ok, thanks ... I can change the rest of the statics bgcolors
in the dialog, license, components, etc
to be the same of the $HWNDPARENT;
but the in startmenu dialog, how can we change the static labels and
buttons bgcolors?


StartMenu doesn't support SetBkColor yet. Put a feature request on SF.


Ok, also for the labels for the "Agree or No Agree" in License
page

:p


Those are buttons with the IDs 1034 for I Agree and 1035 I Disagree. They support color changes too.


Ok, I almost done with
the "painting" :D

But, who can I change the part with the labels

See screenshot


Look for FindWindow in System.nsh. It finds HWNDs inside the inner dialog and sets their texts. Use the same only with SetBkColor instead of SendMessage WM_SETTEXT.


Not all the inner dialgos has it


Not all the inner dialgos has it


Push ${MUI_TEMP1}

FindWindow ${MUI_TEMP1} "#32770" "" $HWNDPARENT
GetDlgItem ${MUI_TEMP1} ${MUI_TEMP1} ${CONTROL}
SendMessage ${MUI_TEMP1} ${WM_SETTEXT} 0 "STR:${TEXT}"

SetBkColor ${MUI_TEMP1} ${NsisColor} ; Nsiscolor is 0x009c9485

Pop ${MUI_TEMP1}

Has what? HWNDs? Every window including buttons, text boxes, dialogs, Internet Explorer windows and even the desktop has a HWND.


Oops!
I forgot to put "Not all the inner text has the BGcolor"
See past post for the screenshot


Did you set the color using SetBkColor? I have mentioned the IDs of the radio buttons in the above post. You can get the rest using resource hacker.


Yes!
I almost done it :D

But still some areas :(


Don't forget to set the inner dialog's color. BTW, you can't change the background color of the branding text thanks to some "nice" Windows limitations.


Ok, after hours my "touchie" hurts :D
What's the ID for the inner dialog and where I should put it?
In ".onInit" or ".onGUIInit"
I'm trying this:


FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1044
SetBkColor $0 0x00FFFFFF

The inner dialog is what you find using FindWindow. The first $0 in the above script of yours.


This sure looks nice!

What colour code would you be using by any chance, since if I use anything other than 0xFFFFFF (same as 0x00FFFFFF) then it goes black.

-Stuart



!define NsisColor "0x009c9485"

!define MUI_CUSTOMFUNCTION_GUIINIT "PaintME"

Function "PaintME"
SetBkColor $HWNDPARENT ${NsisColor}
GetDlgItem $0 $HWNDPARENT 1 ;button
SetBkColor $0 ${NsisColor}
GetDlgItem $0 $HWNDPARENT 2 ;Button
SetBkColor $0 ${NsisColor}
GetDlgItem $0 $HWNDPARENT 3 ;Button
SetBkColor $0 ${NsisColor}
FunctionEnd

Did you manage to paint the hole installer?
Can we see some screenshots?