Old 15th January 2005, 23:22   #1
torikx
Junior Member
 
Join Date: Jan 2005
Posts: 5
MUI: change header text color for a page

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.
torikx is offline   Reply With Quote
Old 18th January 2005, 15:39   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 13th November 2014, 14:25   #3
orhuidobro
Junior Member
 
Join Date: Feb 2014
Posts: 7
Question

Quote:
Originally Posted by kichik View Post
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.
For example, in the Components Page:
code:
GetDlgItem $r3 $HWNDPARENT 1037 ; "Choose Components"
SetCtlColors $r3 0xFFFFFF transparent
GetDlgItem $r3 $HWNDPARENT 1038 ; "Choose which features of..."
SetCtlColors $r3 0xffda00 transparent


I also need to change the text color in Welcome Page:
"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.
orhuidobro is offline   Reply With Quote
Old 13th November 2014, 15:48   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th November 2014, 18:24   #5
orhuidobro
Junior Member
 
Join Date: Feb 2014
Posts: 7
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:
Quote:
[Settings]
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
Could you please help me with a little piece of code, to change the text color in the Welcome page?

Thanks and best regards.

Last edited by orhuidobro; 13th November 2014 at 19:38. Reason: Syntax error
orhuidobro is offline   Reply With Quote
Old 13th November 2014, 19:55   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
The HWND only exists at run-time:

Quote:
!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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th November 2014, 12:48   #7
orhuidobro
Junior Member
 
Join Date: Feb 2014
Posts: 7
Thank you Anders!
orhuidobro is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump