Announcement

Collapse
No announcement yet.

Colour of combobox on directory page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Colour of combobox on directory 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.

  • #2
    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:

    Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
    NSIS FAQ | NSIS Home Page | Donate $
    "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎