Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 271635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:11:44+00:00 2026-05-12T00:11:44+00:00

We’re writing Windows desktop apps using C++ and Win32. Our dialog boxes have an

  • 0

We’re writing Windows desktop apps using C++ and Win32. Our dialog boxes have an ugly appearance with “Windows XP style”: the background to the static text is grey. Where the dialog box background is also grey, this is not a problem, but inside a tab control, where the background is white, the grey background to the text is very noticeable.

In the past we have done a lot of our own drawing of controls, but these days we are trying to use the standard look’n’feel as much as possible, and to avoid overriding standard behaviour as much as possible.

We are using the Win32 API, which is getting a bit dated, but I think the problem occurs even with ATL. We are creating a DIALOGTEMPLATE. The text is in a “static” control (0x0082). The only flag we set for the style is “SS_LEFT”. The text control is inside a tab control: “SysTabControl32” with only one flag: WS_CLIPSIBLINGS set on it. I’ve experimented with SS_WHITERECT and WS_EX_TRANSPARENT and other settings, to no avail.

All of this gets drawn with the standard Windows dialog box message handler. My main question is “what are we doing wrong?” rather than “how can I work around it?”, although I’ll settle for the latter if no-one can help me with the first.

Any ideas?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:11:44+00:00Added an answer on May 12, 2026 at 12:11 am

    We’re not overriding the WM_CTLCOLORSTATIC message. There’s no occurrence of this string in our source code and nothing like it in our message handlers.

    We’ve worked around this problem by overriding the WM_DRAWITEM message for tab controls to paint their contents with the grey background (standard for dialog boxes without tab controls) rather than the white background (standard for the contents of tab controls).

            brush = CreateSolidBrush(GetSysColor(COLOR_MENU));
            FillRect(lpdis->hDC, &lpdis->rcItem, brush);
            SetBkColor(lpdis->hDC, GetSysColor(COLOR_MENU));
            wtext = ToWideStrdup(c->u.tabcontrol.Tabs[lpdis->itemID].name);
            rect = lpdis->rcItem;
            rect.top += DlgMarginY - 1;
            rect.bottom += DlgMarginY;
            DrawTextW(lpdis->hDC, wtext, -1, &rect, DT_CENTER | DT_VCENTER);
            free(wtext);
            DeleteObject(brush);
    

    This is obviously a workaround, not a proper answer to my question.

    Incidentally, we initialise the “common controls”, of which I believe the tab control is one, using code like this…I don’t suppose this is related to the issue?

    #pragma comment(linker, "/manifestdependency:\"type='win32' " \
        "name='Microsoft.Windows.Common-Controls' " \
        "version='6.0.0.0' " \
        "processorArchitecture='*' " \
        "publicKeyToken='6595b64144ccf1df' " \
        "language='*'\"")
    ...
    
    hCommCtrl = GetModuleHandle("comctl32.dll");`
    if (hCommCtrl) {
            ptrInit = (TfcInit_fn) GetProcAddress(hCommCtrl, "InitCommonControlsEx");
            if (ptrInit) {
                data.dwSize = sizeof(INITCOMMONCONTROLSEX);
                data.dwICC  = ctrlClass;
                if (ptrInit(&data) )
                    gCommCtrlsInitialized |= ICC_TAB_CLASSES | ICC_BAR_CLASSES;
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.