PDA

View Full Version : Using SetBkColor to paint the Installer's dialogs


Joel
29th May 2003, 15:28
Ok!
Let's try it...
I'm painting all the dialogs...
-Welcome Page. Done :D
-My first custome page I use a groupbox, I paint the dialog ID,
but can't paint the inside, anyone know how?
Thanks

Joel
29th May 2003, 16:27
I just found that there's a block in each
dialog in the center.
Anyone know that ID, I can't paint that portion... :hang:

kichik
29th May 2003, 16:56
The HWND for this window is returned by InstallOptions. You need to pop it right after MUI_INSTALLOPTIONS_INITDIALOG.

As for the branding text, I have a new idea. The only problem is it will change the color of the license box too... It's the SetSysColors function, you need to call it with System.dll. I don't have the time right now to write the specific code so you'll have to try it on your own.

Joel
29th May 2003, 17:01
Thanks kichik :)
But this thread (http://forums.winamp.com/showthread.php?s=&threadid=136367) actually helps... wow... :D

IceCork
29th May 2003, 17:33
kichik is it possible to color the message boxes for eg. "Are you sure you want to quit setup" ? If so how ?
Lobo Lunar how did you color the next, cancel buttons ?

Joel
29th May 2003, 17:41
Need to send a Message for that..
I don't know wich is.... :(

Does anyone try to paint a custom page dialog...continue with
the pages, then return to that page? The dialog colors return to the
default ones...

Joel
29th May 2003, 18:49
Fixed that :up:
Thanks anyway!


This is my code:

!define MUI_CUSTOMFUNCTION_INSTFILES_SHOW "LogFont"
!define MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW "un.LogFont"

Function "LogFont"
FindWindow $3 "#32770" "" $HWNDPARENT
GetDlgItem $3 $3 1016
CreateFont $4 "Comic Sans Ms" "8" "500"
SendMessage $3 ${WM_SETFONT} $4 0
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1006
SetBkColor $0 0x00E3E3E3
SetBkColor $1 0x00E3E3E3
FunctionEnd

Function "un.LogFont"
FindWindow $3 "#32770" "" $HWNDPARENT
GetDlgItem $3 $3 1016
CreateFont $4 "Times New Roman" "8" "500"
SendMessage $3 ${WM_SETFONT} $4 0
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1006
SetBkColor $0 0x00E3E3E3
SetBkColor $1 0x00E3E3E3
FunctionEnd

All it's great but it doesn't paint the hole dialog in the
Uninstaller dialog "Uninstall files"...
What's wrong?

kichik
30th May 2003, 13:38
You can't change the color of the message boxes without SetSysColors afaik. The only problem is that SetSysyColors sets the colors for every window.

As for the uninstall window, it's the same code as in the other thread, without any GetDlgItem.

Joel
30th May 2003, 15:20
Hi KichiK!
Almost done. See the attach file... working great...but there are
some areas left... I use this code, and it works:

!define MUI_UNCUSTOMFUNCTION_INSTFILES_PRE "un.LogFont1"
!define MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW "un.LogFont2"

Function "un.LogFont1"
SetBkColor $HWNDPARENT ${NsisColor}
GetDlgItem $7 $HWNDPARENT 1028
SetBkColor $7 ${NsisColor}
FunctionEnd

Function "un.LogFont2"
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1016
CreateFont $2 "Comic Sans Ms" "8" "500"
SendMessage $1 ${WM_SETFONT} $2 0
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $5 $R0 1006
SetBkColor $5 ${NsisColor}
GetDlgItem $8 $HWNDPARENT 1016
SetBkColor $8 ${NsisColor}
FunctionEnd


What you think?

IceCork
30th May 2003, 15:26
Could you please post the section of your code that colors the buttons? Or is that your default Windows color ?

Joel
30th May 2003, 15:31
Yes, is my windows color scheme....
I'm still on that, dude... :)

kichik
30th May 2003, 16:46
Same as the uninstaller window, use the code without the GetDlgItem.

Joel
30th May 2003, 21:33
Nothing... :(
Now, testing the hole installer... the NSISdl plugin,
how to paint the portion that it uses in the Dialog?

kichik
31st May 2003, 12:06
You can't change the background color of NSISdl and StartMenu dialogs yet.

Joel
31st May 2003, 15:54
looking for those features :)