Old 20th April 2007, 09:15   #1
bradharding
Member
 
Join Date: Sep 2003
Posts: 53
Colour of combobox on components page

Hi!

Having never been one to leave things alone, I'm in the process of forcing the colours of every single control in my installer. On the components page, for instance, I do this:

code:

; Change the text and background colours of all controls on the page
FindWindow $0 "#32770" "" $HWNDPARENT
SetCtlColors $0 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1006 ; Static text
SetCtlColors $1 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1021 ; "Select the installation type" static text
SetCtlColors $1 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1017 ; Installation type combobox control
SetCtlColors $1 ${BLACK} ${WHITE}
GetDlgItem $1 $0 1022 ; "Select the components" static text
SetCtlColors $1 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1032 ; Components treeview control
SendMessage $1 ${TVM_SETBKCOLOR} 0 ${WHITE}
SendMessage $1 ${TVM_SETTEXTCOLOR} 0 ${BLACK}
GetDlgItem $1 $0 1023 ; "Space required" static text
SetCtlColors $1 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1042 ; Description groupbox control
SetCtlColors $1 ${BLACK} ${GRAY}
GetDlgItem $1 $0 1043 ; Description static text
SetCtlColors $1 ${BLACK} ${GRAY}



Which works fine, but there are 2 things I don't know how to do. How would I change the colour of 1) the dropdown part of the combobox control (dialog id # 1017) and 2) the "Description" title of the groupbox control (dialog id # 1042)?

Any help would be greatly appreciated!

Thanks in advance,
Brad.
bradharding is offline   Reply With Quote
Old 20th April 2007, 13:59   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
To set the color of the combo box drop down list, use the following.
code:
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1017
SetCtlColors $1 00ff00 ff0000
System::Call '*(i 52, i, i, i, i, i, i, i, i, i, i, i, i 0) i .r0'
System::Call 'user32::GetComboBoxInfo(i r1, i r0)'
System::Call '*$0(i, i, i, i, i, i, i, i, i, i, i, i, i .r1)'
System::Free $0
SetCtlColors $1 00ff00 ff0000

As for the text color of the group box title, that only works when not using XP themes. See the following thread:

http://forums.winamp.com/showthread....color+groupbox

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 20th April 2007, 21:58   #3
bradharding
Member
 
Join Date: Sep 2003
Posts: 53
Thanks again, kichik! That did the trick!

Now all that's really left to do now are the colours of the buttons, and the inside background colours of the checkboxes (startmenu and finish pages), radio buttons (license page) and the progress bar.
I can see from previous posts that this is not possible to be done for the buttons, but how about the others? Can they be changed, at least for when not using XP themes?

Regards,

Brad.
bradharding is offline   Reply With Quote
Old 20th April 2007, 22:03   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
All of those can only be changed with owner drawn controls. wansis does that, but it converts everything and not just your selection of controls. SkinnedButton can skin just buttons. You might be able to change both to skin exactly what you need but it'd require C code.

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