- NSIS Discussion
- custom page colours in footer
Archive: custom page colours in footer
dfranklin72
7th July 2009 18:29 UTC
custom page colours in footer
Thanks for everyones help so far. my installer is now taking shape. I have created multiple custom pages and would like to know if its possible to change the colour of the footer. see screenshot.
Im using: on each page with 500 * 310 image size
Function page1
nsDialogs::Create 1044
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateBitmap} 0u 0u 100% 100% ""
Pop $Image
${NSD_SetImage} $Image $PLUGINSDIR\Page2.bmp $ImageHandle
nsDialogs::Show
${NSD_FreeImage} $ImageHandle
Functionend
Is it also possible to change the button colours?
Thanks again
kichik
18th July 2009 13:46 UTC
Using SetCtlColors on $HWNDPARENT should do the trick. Same for buttons. Use GetDlgItem to get them. Their ids are 1 for Next, 2 for Cancel and 3 for Back.
dfranklin72
20th July 2009 21:42 UTC
Thanks for all your help.
I understand how to get the control with resource hacker but I can’t find the handle I need?
I have also struggled with the install files page which I’m having to use.
Code:
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1006
SetCtlColors $1 ffffff 000000
FindWindow $0 "#32770" "" $HWNDPARENT
SetCtlColors $0 ffffff 000000
!define MUI_BGCOLOR 000000
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_PITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR\Black.bmp"
Is producing the screenshot.
I still have two issues. How do I get rid of the grey on either screens.
dfranklin72
20th July 2009 21:48 UTC
screenshot attached
Afrow UK
20th July 2009 21:52 UTC
!define MUI_CUSTOMFUNCTION_GUIINIT myOnGUIInit
...
Function myOnGUIInit
SetCtlColors $HWNDPARENT ffffff 000000
GetDlgItem $0 $HWNDPARENT 1
SetCtlColors $0 ffffff 000000
GetDlgItem $0 $HWNDPARENT 2
SetCtlColors $0 ffffff 000000
GetDlgItem $0 $HWNDPARENT 3
SetCtlColors $0 ffffff 000000
FunctionEnd
Edit: Added buttons.
Stu
dfranklin72
20th July 2009 22:05 UTC
Thats it, well nearly. Do I have to set the branding text colour or additional contols on each window. there is a grey line dividing the screen at the top and bottom.
thx again
dfranklin72
20th July 2009 22:07 UTC
screenshot attached again
thx
dfranklin72
20th July 2009 22:15 UTC
ok adding the following gets rid of the branding text issue.
GetDlgItem $R0 $HWNDPARENT 1028
SetCtlColors $R0 000000 000000
dfranklin72
20th July 2009 22:58 UTC
I think its the image sizes im using. Is there any refence that has the max image sizes/control in pixels.
Afrow UK
21st July 2009 01:17 UTC
Instead of changing their colours just hide them with ShowWindow $hwnd ${SW_HIDE}
Also I edited my post above (looks like you missed it). Included code for the buttons. All the code to apply colours etc to the outer dialog ($HWNDPARENT) should be in there.
Stu
dfranklin72
21st July 2009 10:33 UTC
i tried adding:, to both your function and or to the section
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $HWNDPARENT 1036
ShowWindow $HWNDPARENT ${SW_HIDE}
but his seems to close the whole window. i thought 1036 was the control I was looking for? I still have the grey line.
Afrow UK
21st July 2009 10:54 UTC
I don't think you know what you're doing. What do you expect if you hide $HWNDPARENT?
Your function should look like this:
Function myOnGUIInit
SetCtlColors $HWNDPARENT ffffff 000000
GetDlgItem $0 $HWNDPARENT 1
SetCtlColors $0 ffffff 000000
GetDlgItem $0 $HWNDPARENT 2
SetCtlColors $0 ffffff 000000
GetDlgItem $0 $HWNDPARENT 3
SetCtlColors $0 ffffff 000000
GetDlgItem $0 $HWNDPARENT 1035
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1036
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1045
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1028
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1256
ShowWindow $0 ${SW_HIDE}
FunctionEnd
Stu
dfranklin72
21st July 2009 11:41 UTC
I'm not going to disagree:) My mistake, I should have seen that one. Thanks again for your help on this Stu. its looking great now.