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

  • Home
  • SEARCH
  • 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
  • 0 Views
  • 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

Ask A Question

Stats

  • Questions 156k
  • Answers 156k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer UIApplicationDelegate is a protocol definition, which means it's a set… May 12, 2026 at 10:48 am
  • Editorial Team
    Editorial Team added an answer Build app and launch on device Launch Shark From the… May 12, 2026 at 10:48 am
  • Editorial Team
    Editorial Team added an answer Just override OnDataBinding method, not DataBind: protected override void OnDataBinding(EventArgs… May 12, 2026 at 10:48 am

Related Questions

We are developing a little application that given a directory with PDF files creates
We have been using CruiseControl for quite a while with NUnit and NAnt. For
We have a requirement in project to store all the revisions(Change History) for the
We have a remoting singleton server running in a separate windows service (let's call
We have an SVN repository running on a Windows server, and I want to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.