Skip to content
⌘ NSIS Forum Archive

License Background Colour

14 posts

C_Denton#

License Background Colour

Is there any way to change to the background colour of the License text box so that you can have diffrent colours for each License page?
onad#
So, you have MULTIPLE license pages, next time let us know beforehand 😉

anyhow use something along the lines of:

!define MUI_PAGE_LICENSE_PRE MUI_PAGE_LICENSE_SetBackgroundColor

...

Function MUI_PAGE_LICENSE_SetBackgroundColor
...do your thing here...

FunctionEnd
C_Denton#
Ok, what I've got at the moment is:

!define MUI_PAGE_CUSTOMFUNCTION_PRE ChangeColour

Function ChangeColour
FindWindow $0 ""#32770"" "" $HWNDPARENT
GetDlgItem $0 $0 1000
SetCtlColors $0 0xFF0000 0x00FF00
FunctioEnd

Doesn't seem to work though
Afrow UK#
so that you can have diffrent colours for each License page?
😛 (ok not that apparent, but still)

The ...do your thing here... doesn't seem to work.

FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1000
SetCtlColors $R0 "" FF0000

I think it's because it's a RichEdit20A control.
You can't change the font colour of it either (you can do so with other controls on the dialog though).

-Stu
C_Denton#
Cheers, but I can't seem to get it to work

My function so far:

FindWindow $0 ""#32770"" "" $HWNDPARENT
GetDlgItem $0 $0 1000
SendMessage $0 ${EM_SETBKGNDCOLOR} 0xFF0000 0x00FF00
Afrow UK#
You need !define EM_SETBKGNDCOLOR in your script too (it's not in WinMessages.nsh)
It's WM_USER + 67 (0x400 + 67) but I'm not sure what the correct answer to that is.

-Stu
Afrow UK#
EM_SETBKGNDCOLOR seems to be 1091 but I can't get the colour codes to work.

Edit: Now it works (had a look at http://msdn.microsoft.com/library/en...bkgndcolor.asp).

!define EM_SETBKGNDCOLOR 1091

Function show
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1000
SendMessage $R0 ${EM_SETBKGNDCOLOR} 0 0xC0C0C0
FunctionEnd

-Stu
Afrow UK#
!define MUI_PAGE_CUSTOMFUNCTION_SHOW licenseAShow
!insertmacro MUI_PAGE_LICENSE "license.txt"

!define EM_SETBKGNDCOLOR 1091

Function licenseAShow
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1000
SendMessage $R0 ${EM_SETBKGNDCOLOR} 0 0xC0C0C0
FunctionEnd
-Stu
C_Denton#
Thanks for your help!

In case anyone else finds this thread useful I should warn you that the colours format is BGR (instead of the normal RGB).