Is Microsoft plans to support "Dark Mode" in its own application

Igor Korot 6 Reputation points
2023-01-05T17:02:43.327+00:00

Hi, ALL,

More and more people are switching to use "Dark Mode".

However, it looks like native Windows applications are not supporting "Dark Mode" as they use different coloring scheme.

Does MS have plans to update Win32/MFC application/SDK to support "Dark Mode"?

If not - what is recommended way of updating the application to look good in "Dark Mode"?

Thank you.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,732 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 85,211 Reputation points
    2023-01-05T20:19:04.97+00:00

    If not - what is recommended way of updating the application to look good in "Dark Mode"?

    Not the recommended way, but an usual way is
    to detect dark/light mode change with WM_SETTINGCHANGE and lParam = "ImmersiveColorSet"
    Then you can use undocumented functions from UXTheme.dll called by ordinal and named like SetPreferredAppMode, AllowDarkModeForWindow, ... (many samples on Google in C++ or C#)

    • SetWindowTheme with "Explorer"
    • DwmSetWindowAttribute and DWMWA_USE_IMMERSIVE_DARK_MODE for the caption

    For example, a quick test with a Button and Context Menu in C++/Win32, Light/Dark:
    276635-light-test.jpg 276675-dark-test.jpg

    3 people found this answer helpful.

  2. Michael Taylor 54,321 Reputation points
    2023-01-05T17:31:27.323+00:00

    I cannot answer to MS's plans for MFC but from my understanding it is not really a framework they are actively maintaining. Yes it ships with VS but so does ATL and only because these are the only frameworks for C++ that MS provides. Today if you were to ask MS about building a UI they are going to push you toward WinUI3 or .NET UIs like Maui or WPF (or whatever we're calling it today). Therefore I would be shocked if there is any investment in updating MFC beyond recompiling for the newer C++ libraries.

    At the same time you have a compatibility issue as well. MFC is just a wrapper around Win32 and therefore the bulk of the functionality is provided there. MFC cannot just be updated to use functionality only available on newer OSes without breaking support for existing OSes and that would be a major issue for MFC. So I think the best option, outside of moving away from MFC if you need this behavior, is to use a third party library that might support it.

    But 5 years ago someone tried to start making MFC support the Windows theme. You can read about their efforts here. Be aware though that there are going to be gaps and issues, lots of code to write and probably things that aren't going to work properly. The key is the CMFCVisualManager class which is where the existing MFC framework is able to support some of the (new/old) Office themes back when Office was doing this. However I'm not convinced that just creating a derived type from that class will make everything work correctly.

    Retrofitting a modern UI onto a legacy framework just isn't feasible. If you really want a modern UI then maybe you should consider updating the UI to a modern framework and leave your non-UI C++ code as is. They can work together. But this is just my opinion.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.