Archive: How to make forms background white?


How to make forms background white?
Hello community,

Please advise, how can I make background color of all my forms (Pages) in NSIS installer white? Custom Pages and standard MUI pages?

I am taking not about BGGradient function, but about forms that will be showed with
Page custom ... insructions

For example like here
http://nsis.sourceforge.net/mediawik...creenshot6.png or here http://nsis.sourceforge.net/mediawik...reenshot5.png, but not only for Welcome of Finish pages but for all other pages too.
For example how to make background color white here http://nsis.sourceforge.net/mediawik...creenshot1.png ?

I tried to use
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1001
SetCtlColors $R0 0xFFFFFF 0x000000
In my scripts, but it don't works.

Thanks.


Use Resource Hacker to modify the UI, then use ChangeUI to change the dialog.


You can't change the colours of controls with Resource Hacker.

Take a look at Custom pages > Using InstallOptions for custom pages. There's an example further down which shows how to change the font of a control.

As for all the NSIS pages, you need to apply the background colours for all controls in the dialogs. This applies to controls inside the inner dialog (which you get using FindWindow which you have already got) and the outer dialog ($HWNDPARENT).

To get all the control ID's you need to use Resource Hacker. IDD 105 is the the outer (parent) dialog whereas the rest are all inner dialogs.

-Stu


Use the InstallOptions "Rect" field to set the control that will host the child window:

[Settings]
Rect=1044
Then, skin the background of the window:
Page custom Init Verify

Function Init
!insertmacro MUI_INSTALLOPTIONS_EXTRACT InstallOptions.ini
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\InstallOptions.ini"
Pop $1
SetCtlColors $1 0xFFFFFF 0xFFFFFF
StrCpy $2 1199
SkinLoop:
IntOp $2 $2 + 1
GetDlgItem $0 $1 $2
SetCtlColors $0 0x000000 0xFFFFFF
IntCmp $2 1300 SkinLoop SkinLoop ""
InstallOptions::show
FunctionEnd

Function Verify
# any custom code to verify the user's input here...
FunctionEnd
If your dialog has more than 100 fields (not likely) increase the 1300 to any value >1201, but the higher you go, the longer it will take to initialize the page, especially on slower systems.

Edit: you could probably do this with a for-loop in LogicLib, but this will work just as well.

-dandaman32

Dan, this approach works great, but I ran into a little problem. When I do this on a custom finish page, it makes my header line regular-sized and un-bolded.

I tried excluding that field from the skinloop:

!insertmacro MUI_INSTALLOPTIONS_READ $3 "ioCustom.ini" "Field 2" "HWND"
SkinLoop:
IntOp $2 $2 + 1
GetDlgItem $0 $1 $2
${If} $0 <> $3
SetCtlColors $0 0x000000 0xFFFFFF
${EndIf}
....

but that left the text unformatted as well.

Any ideas on how to retain the header line formatting? Comparing the header entries in ioSpecial.ini and ioCustom.ini, they look identical.

Thanks!


I thought I'd exhausted my search of the forum, but I just ran across Afrow UK's reference to CreateFont in another thread, and it works perfectly.

For reference, that post is here:
http://forums.winamp.com/showthread....xt+custom+page