Windows Dark Mode for Built Apps

What is the roadmap for supporting dark mode for windows built apps? The latest roll out of the Windows 10 update now supports dark mode, but I see that DM is only supported in macOS? Is this correct?

It’s uh, not even on the Roadmap.
https://documentation.xojo.com/resources/roadmap.html

Last I knew this was a Microsoft limitation. Windows dark mode does not officially support Win32 apps as far as I’m aware. Once that happens, I imagine Xojo could make it happen without too much fuss.

Unlikely to happen. In my opinion it’s more likely that MS uses it to push people toward 64bit, because with Win 11 I’d expect that’s where they want to be …

Win32 doesn’t mean 32-bit.

5 Likes

So what methods are Windows developers using to enable Xojo desktop apps to support dark mode? Is there a system call to see if dark mode is active? Or do you just provide an option in your apps to turn the app’s dark mode on and off?

Or so you just always use the current Windows system colors? If so, where can I find calls to get those colors?

Before Xojo started thinking about it, and because I still use Xojo 2015 for my Windows builds, I went down a route of subclassing some controls, and creating my own button and toolbar replacements.

One ‘quick n dirty’ method I use to guess if the Windows scheme is dark is this code:

      dim dk as color = WinGetSysColorMBS(15)
      IF DK.VALUE < 0.1 THEN
        WindowsIsProbablyDark =true
      END IF

And then (very broadly) I respond by painting things in dark colors with white text.
Some thing I have no control over… tabs, panels, menus spring to mind.
I do also have an app preference to force this to happen (or not)

Newer Xojo versions offer something automatic which I have not tried. (Sadly haven’t been able to use any Xojo version for Windows after 2016)

I built a framework to re-theme Xojo’s windows and controls for dark and light mode depending on the system in use, complete with detecting the appearance change. Once Xojo implemented dark mode, though, my system became redundant so it was removed. Parts of it are still used in GraffitiSuite, such as retrieving the color values for tons of immersive system colors defined in recent versions of Windows and the appearance change detection.

There are APIs for dark/light detection and re-theming, but there are limitations to Win32 that make it a bit of a pain. I’d recommend turning on dark mode support in your project and checking Color.IsDarkMode with either pre-defined colors or the available system colors in the Color namespace if you don’t have GraffitiSuite. If you do have GraffitiSuite, there’s a massive amount of possibility in GraffitiColors (Windows | Immersive).

This is really helpful, thank you!