Archive: License Background Colour


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?


Did you tried to use LicenseBkColor?


Yes but that changes the colour for all the license pages


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


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


so that you can have diffrent colours for each License page?
:p (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

Send it EM_SETBKGNDCOLOR instead of using SetCtlColors.


Whis is WM_USER + 67 which is... 0x400 + 67?
What would that come to?

-Stu


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


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


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, Could you post your full working code as I can't seem to get it to work


!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

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).