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

Dorlig Na 1 Reputation point
2020-07-01T07:41:43.303+00:00

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 changing 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 which can be used as current active theme, but "choose your default app mode" setting. I think they are different settings which are set separately.

I guess if I can get correct HTHEME of it, then I can get all colors in it. But how to get the correct HTHEME of the theme of this "choose your default app mode" light/dark mode?
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,966 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,721 Reputation points Microsoft Vendor
    2020-07-01T08:28:39.163+00:00

    Hello,

    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