How to get colors of default app mode "Dark" in my Win32 App

Dorlig Na 1 Reputation point

There is "choose your default app mode" in Win10 setting with two options, "Light" and "Dark". I know an UWP app automatically respond to the setting and change its appearance automatically. Now the Win32 common file open dialog in a simple MFC app also respond to this setting and change its appearance automatically. I can respond to this setting change by respond to WM_SETTINGCHANGE, but how can I get the colors of this "Dark" mode in a Win32 app or a MFC app. I tried to use theme API as following, but it always return the color of "Current Theme" but not the "default app mode".

HTHEME hTheme = OpenThemeData (NULL, L"CompositedWindow::Window");
if (hTheme)
    COLORREF btnFaceColor = GetThemeSysColor (hTheme, TMT_BTNFACE);

BTW, I'm not talking about high contrast Theme, but "choose your default app mode" setting. I suppose they are different settings which are set differently.

  I guess if I can get correct HTHEME of it, then I can get all colors in it. but how?
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,618 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,731 Reputation points Microsoft Vendor


    Welcome to Microsoft Q&A!

    Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).

    Your question about win32 app development is not supported yet now. You could ask about this in General Windows Desktop Development Issues forum.

    Thank you.

    0 comments No comments