ysc3839 / win32-darkmode

Example application shows how to use undocumented dark mode API introduced in Windows 10 1809.
MIT License
437 stars 48 forks source link

What would cause AllowDarkModeForWindow to return false? #11

Open ga2k opened 4 years ago

ga2k commented 4 years ago

I'm trying to implement this in a wxWidgets app. I call InitDarkMode() and g_darkModeSupported gets set to true, and the main menus are dark (nice!) and so are the scrollbars.

However, creating a window then calling AllowDarkModeForWindow() with the HWND of the window (or a control, doesn't matter) returns false, and window is not dark.

Any clues? I'm on Windows 10 Pro Version 20H2 OS Build 19042.508 (and yes, I've modified my version of CheckBuildNumber() to be >= 19041 instead of == 19041...)

ysc3839 commented 4 years ago

In 19041, the AllowDarkModeForWindow returns last state of dark mode: image

What's the class name of that window?