- NSIS Discussion
- A few questions about SetBkColor
Archive: A few questions about SetBkColor
Joel
29th March 2003 15:57 UTC
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
kichik
29th March 2003 16:06 UTC
Like controls dialogs have a HWND too. For example, the outer dialog's HWND is $HWNDPARENT.
Joel
29th March 2003 16:27 UTC
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?
kichik
29th March 2003 16:31 UTC
StartMenu doesn't support SetBkColor yet. Put a feature request on SF.
Joel
29th March 2003 18:35 UTC
Ok, also for the labels for the "Agree or No Agree" in License
page
:p
kichik
29th March 2003 18:39 UTC
Those are buttons with the IDs 1034 for I Agree and 1035 I Disagree. They support color changes too.
Joel
29th March 2003 19:33 UTC
Ok, I almost done with
the "painting" :D
But, who can I change the part with the labels
See screenshot
kichik
29th March 2003 19:37 UTC
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.
Joel
29th March 2003 20:10 UTC
Not all the inner dialgos has it
Joel
29th March 2003 20:12 UTC
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}
kichik
29th March 2003 20:12 UTC
Has what? HWNDs? Every window including buttons, text boxes, dialogs, Internet Explorer windows and even the desktop has a HWND.
Joel
29th March 2003 20:30 UTC
Oops!
I forgot to put "Not all the inner text has the BGcolor"
See past post for the screenshot
kichik
29th March 2003 20:37 UTC
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.
Joel
29th March 2003 23:51 UTC
Yes!
I almost done it :D
But still some areas :(
kichik
30th March 2003 13:11 UTC
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.
Joel
30th March 2003 15:51 UTC
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
kichik
30th March 2003 15:56 UTC
The inner dialog is what you find using FindWindow. The first $0 in the above script of yours.
Afrow UK
30th March 2003 16:41 UTC
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
Joel
30th March 2003 18:31 UTC
!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?