dark mode on windows?

My app looks great (in my opinion) in Dark Mode on the Mac.
However when I run it on windows (64 bit) it looks like a regular ‘not dark mode’ app.
Is that normal?

Xojo only handles Dark Mode on macOS https://documentation.xojo.com/topics/user_interface/desktop/macos/supporting_macos_dark_mode.html

Dark Mode on Windows is a beast… having trouble tracking down some window message issues… was looking in the forums to see if anyone else has been tapping the API/COM interfaces; This is all I could find for threads :frowning: Any input or ideas as to what may be causing the issues below?

Here’s a video of the Xojo project:
Xojo: Exploring Windows Dark Mode Potential

Video Timeline (Issues in Bold):

00:06 - Windows application built in debug mode

00:12 - Opening subordinate “About Window”

00:16 - Applying Windows default app mode setting to “Dark” mode

00:19 - Application and all windows have successfully converted to dark mode.

00:23 - About Window closed from titlebar

00:24 - Main Demo window is Maximized

*** 00:25 - Main Demo window is resumed from maximize, but behaves oddly by remaining at the top of the screen, but inherits original dimensions prior to maximize.

00:28 - Main Demo window repositioned to random screen location and maximized again.

*** 00:30 - Main Demo window is resumed from maximize, but returns to its original location and dimensions as prior to maximize.

00:35 - Main Demo window repositioned & About Window re-opened in Dark mode.

*** 00:39 - Light mode has been applied and all Windows have reconverted to light mode. Xojo project windows are missing their title bars. Menu has remained in place.

00:45 - Dark mode has been re-applied, and all windows have converted to dark mode.

*** 00:52 - Attempting to close a subordinate window after re-applying dark mode for a second time will crash the program. Subordinate window returns nil handle.

**The blue button is a canvas drawn button to see how drawn controls react to dark mode (no different than light mode). Not all controls have been hooked and mapped to styles (ie menus). This is just a proof-of-concept.

Dark mode is not frequent on Windows. Users are not expecting it.

That’s awesome… But this is a method to apply any Windows style …even custom ones. Dark mode is merely proof-of-concept since it’s standard and easily understood. If I start throwing out Mac style windows on a Windows system…people won’t understand what’s going on, and miss the point. :slight_smile: just trying to track down solutions to the bugs. Found once applying a custom window style, you have to “cache” any subordinate window handles to the opened and closed sub windows. Have fixed the issue with sub windows crashing the main thread though. The maximize window and return back to default restored window size and location issue is still random. Added “forced style mode” to apply custom windows styles even if they’re not set as default, so they may be applied regardless of system settings… Styles can be included with the application package also. This is very useful to many outside of Dark Mode styles, or they wouldn’t be asking for it :slight_smile: There’s a demand and apparently I have the only supply. Someone has to figure it out…no one else is… There’s not even a tidbit of information in the forums that even begins to touch the surface… Just lots of unanswered questions. I turn every stone until I find a solution. Impossible is never an option…

1 Like

The only app I have encountered which was doing dark mode is NVidia GEForce Experience.

It probably pleases a lot of gamers.

It serves as a good proof of concept. So it can be done.

From my past experience with Vista, I remember being able to heavily customize windows color and transparency. That could become handy for dark mode.

As far as I recall, we used Regions, akin to the custom window shape example.
Example Projects\Platform-Specific\Windows\CustomWindowShape

Now, the question becomes, is there a real market for a dark mode utility in Xojo Windows ?

I am convinced you could indeed produce it, but is it worth spending time to sell 4 or 5 in total ?

https://www.google.com/search?biw=1134&bih=830&tbm=isch&sxsrf=ACYBGNTeJIXYbI71j_Scx3eWSCqbm8IK8A%3A1573423057999&sa=1&ei=0YfIXa_SPJqGjLsP692MiAU&q=nvidia+geforce+experience&oq=nvidia+geforce+experience&gs_l=img.3..0l10.14395.16303..18054...0.0..0.134.881.10j1…0…1…gws-wiz-img…0i67.8UmsF5JHJWA&ved=0ahUKEwjv_s_T0eDlAhUaA2MBHesuA1EQ4dUDCAc&uact=5#imgrc=pqMfRE1DT7q6HM:

VersionTracker.app supports dark mode on Windows using tools available now from GraffitiSuite. We all know @Anthony Cyphers who is a regular participant on the forum and is prompt with support. I’d recommend GraffitiSuite for dark mode support if you’re interested in it.

There’s some tricks to pulling it off in Xojo since it’s not officially supported, you may have to get clever with inputs as not all controls are available.

“Dark Mode” in Windows could mean the dark theme which jave existed since about Windows 3.1 OR the much newer Dark Mode introduced as part of Windows 10

The older dark mode can access the older color theme colors relatively simply using Win32 API’s
The Windows 10 one I’m sure Anthony could vouch for being a real pain in the butt

And without some Xojo support things like the Window frame may still not be properly themed

That’s High Contrast. Not the same thing.

I have the window frame theming done as of two days ago. I also have menuitems themed, as well as a number of the native controls.

[quote=462754:@Anthony Cyphers]That’s High Contrast. Not the same thing.
[/quote]
right but it is what some have referred to as “dark mode” although its incorrect

Oooh nifty !

The picture you show is not entirely dark mode. The window bar and it’s menu are not dark mode.

[quote=462751:@Norman Palardy]
And without some Xojo support things like the Window frame may still not be properly themed[/quote]

although

[quote=462754:@Anthony Cyphers]
I have the window frame theming done as of two days ago. I also have menuitems themed, as well as a number of the native controls.[/quote]

There are some caveats to the current implementation.
To do Dark Mode right in Win32 currently requires a mix of implementing the Desktop Window Manager documented APIs, User Theme undocumented APIs and custom drawing. The first step for Dark Mode support was to tackle the undocumented but, more-or-less, static APIs (by Windows build) in order to support custom user-drawn components. The second step is theming the native controls, and the third step is finishing out the custom drawing for the menubar (which requires subclassing of the individual window elements to implement properly for Win32).

A better way to describe what Tim showed, and what I’ve been calling it as it’s more accurate per the effect and the APIs, is “Immersive” rather than “Dark Mode”. The theme is dark, the effect and APIs are immersive, and when coded properly are adaptive.

[quote=462748:@Tim Parnell]
There’s some tricks to pulling it off in Xojo since it’s not officially supported[/quote]
These menubars aren’t faked and inaccessible canvases. :shrug:
Throughout VersionTracker (and all my work) I prefer native actual controls to canvases. I wouldn’t sacrifice usability for visuals.

[quote=462762:@Tim Parnell]These menubars aren’t faked and inaccessible canvases. :shrug:
Throughout VersionTracker (and all my work) I prefer native actual controls to canvases. I wouldn’t sacrifice usability for visuals.[/quote]

As I said above, dark mode is not frequent on Windows, and users do not expect it. Actually, I am not even sure they would not be frightened.

Personally, I do not care much for dark mode on Mac. Sorry, but it reminds me too much of my antiquated black and green Apple IIc screen back in 1982.

That said, at the risk of contradicting you, changing the color of the window bar and the menu does not require canvases. As a matter of fact, this effect was well known back in the Vista era. After the terrible commercial catastrophe, not many programmers remember it, though. Everything is there, though.

I believe this statement to be outdated. Dark mode is a determining factor on most or the programs I use.

Here is the list of dark mode apps I use regularly on windows.

  1. Windows preferences and settings.
  2. Windows explorer
  3. Outlook (Also has dark reading mode to change email content to dark).
  4. Excel
  5. Fork (I used to use Source Tree, but switched to fork. One of the biggest reasons was a better dark theme - Source Tree dark theme is blue).
  6. Visual Studio
  7. NetBeans

That you have to set each individually is just disappointing

Awe… it’s not that bad. All the windows stuff changes with one setting (file explorer, settings, and built in apps like weather).
For other apps it’s a one time setting that you change when you install the app. It could be a big deal if you regular switched between dark and light mode, but then you’d probably need a sanity check anyway :slight_smile:

Unfortunately, adding immersive support for Win32 apps is kind of a PITA due to Microsoft having three different UI frameworks. If every developer could/would move to UWP it wouldn’t be an issue and all apps would just switch over with the selected theme.