Hi,
I'd like to change the color of header text for a *certain* page, how can I do that?
i.e.
!define MUI_PAGE_HEADER_TEXT "some text"
!define MUI_PAGE_HEADER_SUBTEXT "some subtext"
display "some text" in red, display "some subtext" in green, etc.
MUI: change header text color for a page
7 posts
Use GetDlgItem and SetCtlColors. To find out the item id, use Resource Hacker. Search the forum for GetDlgItem, SetCtlColors and/or Resource Hacker and you should be able to find some examples.
Hello Kichik, I was able to change the text color in headings using your suggestions. 🙂Originally Posted by kichik View PostUse GetDlgItem and SetCtlColors. To find out the item id, use Resource Hacker. Search the forum for GetDlgItem, SetCtlColors and/or Resource Hacker and you should be able to find some examples.
For example, in the Components Page:
I also need to change the text color in Welcome Page:GetDlgItem $r3 $HWNDPARENT 1037 ; "Choose Components"
SetCtlColors $r3 0xFFFFFF transparent
GetDlgItem $r3 $HWNDPARENT 1038 ; "Choose which features of..."
SetCtlColors $r3 0xffda00 transparent
"Welcome to ... Setup"
"Setup will guide you through the installation..."
But I wasn't able to find the resource numbers for these text blocks. I used Resource Hacker, and found many Dialogs listed there, but it seems Welcome Page isn't there.
Is it possible to do what I want?
Can it be done just knowing the codes, or a different approach is needed?
Thanks and best regards.
The Welcome page is a custom page, you can use WinSpy++ at run-time to find the control id. If you are using MUI2 you can look for the correct variable name in the MUI source or for MUI1 you might be able to read the HWND from the .ini.
Hi Anders, thank you for your timely response.
Looking to Modern UI\ioSpecial.ini, I wasn't able to figure out which are the resource numbers for these text blocks.
The .INI file is:
Thanks and best regards.
Looking to Modern UI\ioSpecial.ini, I wasn't able to figure out which are the resource numbers for these text blocks.
The .INI file is:
[Settings]Could you please help me with a little piece of code, to change the text color in the Welcome page?
Rect=1044
NumFields=3
[Field 1]
Type=bitmap
Left=0
Right=109
Top=0
Bottom=193
Flags=RESIZETOFIT
[Field 2]
Type=label
Left=120
Right=315
Top=10
[Field 3]
Type=label
Left=120
Right=315
Thanks and best regards.
The HWND only exists at run-time:
!include MUI.nsh
!include InstallOptions.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomeColors
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
Function WelcomeColors
!insertmacro INSTALLOPTIONS_READ $0 "ioSpecial.ini" "Field 2" "HWND"
SetCtlColors $0 0xff1133 transparent
!insertmacro INSTALLOPTIONS_READ $0 "ioSpecial.ini" "Field 3" "HWND"
SetCtlColors $0 0xaa00ff transparent
FunctionEnd
Thank you Anders!