No announcement yet.

Active Border Color

  • Filter
  • Time
  • Show
Clear All
new posts

  • Active Border Color

    Hey all, anyone out there off the top of their head know what the
    api function for changing a window's titlebar color to the current
    system's active titlebar color without actually activating the
    window? I assume;perhaps incorrectly, that SetActiveWindow uses
    another function for actually changing the color of the bar to the
    active color. I have a dialog with a tab control and I am using
    modeless dialogs(from a resource script and CreateDialog api) for the
    "tab sheets". All is working fine except for this one thing.
    Want to keep the active border color on the main dialog when I click
    on a control of one the tab sheets. That's why I am asking.
    Been looking through the help guide and msdn and haven't found
    it yet. I just need to know the name of the function - I can
    take the rest from there.



  • #2
    Adam --
    Theoretically it's possible to use SetSysColors to "full" Windows and to draw "active" caption instead "inactive".
    But to avoid side effects better to have owner-drawn caption (this way is not so easy).

    I am curious, which styles have tab sheets and why ?
    If they have WS_CHILD, why your main dialog changes color ?

    E-MAIL: [email protected]


    • #3

      You process the %WM_NCACTIVATE message !

      This allows you to have multiple windows with their caption
      bar highlighted. This message doesn't allow you to
      change the caption bar color to a different color though.

      Chris Boss
      Computer Workshop
      Developer of "EZGUI"


      • #4
        Semen - at present I am using WS_CHILD,WS_POPUP and WS_CLIPSIBLINGS.
        That is of course subject to change. I am just creating a ordinary
        modal dialog box with a tab control - nothing fancy. They are just ordinary
        dialog templates with no titlebars and no borders to hold the
        Chris - I will check out %WM_NCACTIVATE! Thnxs!


        P.S. Oops, just discovered I can't use WS_CHILD and WS_POPUP together
        silly me! Well, back to drawing board! Got rid of WS_CHILD
        and kept WS_POPUP since I do not want borders on them.

        [This message has been edited by Adam Ritchie (edited April 23, 2001).]


        • #5
          You know if you tinker around long enough, it's amazing what
          will "popup". I replaced WS_POPUP and WS_CLIPSIBLINGS with
          just WS_CHILD and it is doing exactly what I want. Amazing
          what happens when you specify the correct style bits!
          Have a nice day gentlemen!

          Thnxs guys,



          • #6
            to ensure that the tab order works correctly in a tabbed-dialog app (between the tab control itself, other controls on the main dialog such as ok, cancel, etc, and the controls on the tabbed page dialogs), the parent window should have the extended style %ws_ex_controlparent, and the modeless tab page dialogs (which must be children of the main dialog, not the tab control) should have the style %ds_control added.

            many moons ago i posted an example of creating a tabbed dialog in the srccode (archive) forum... i'll see if i can find the reference...

            here it is: but on 2nd look it not demonstrate the %ws_ex_controlparent %ds_control issues.

            a quick search for "ds_control" finds this example:

            i hope this helps!

            powerbasic support
            mailto:[email protected][email protected]</a>
            mailto:[email protected]


            • #7
              Thanks for the info and the links Lance! I will check out the