Closed davidhewitt closed 5 years ago
It's interesting to note Microsoft themselves have published code using 19 as the constant here: terminal/windowtheme.cpp
If they're breaking their own public, published code now, maybe it's really a bug in the Insider build that should be reported & fixed in the OS before it makes it to proper release versions? (That's the point of Insider builds, I would have thought, to test things and report bugs in the OS itself. And then Microsoft ignore everything, and still fail to document anything, of course. :) )
Good idea; I reported it on the Insiders "Feedback Hub": https://aka.ms/AA6lz3k
I will have a look when I have time. By the way, I remembered only open/save dialog has dark titlebar. However in 1909 it is normal titlebar. I guess this feature is to be removed?
Just tested in 1909, both 19 and 20 doesn't work.
That is my mistake.
I set HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\AccentColorInactive
, which overrides dark titlebar color in 1909, but not in 1809.
I set HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\AccentColorInactive, which overrides dark titlebar color in 1909, but not in 1809.
So if I understand correctly, you're on 1909 at the moment, and observing that 19
is still the correct constant to use on your system?
@davidhewitt Yes.
I confirmed that in 19028 the attribute constant is 20.
I also found that this effect is done by SetPropW UseImmersiveDarkModeColors
in 1809. And since 1903 it changed to SetWindowCompositionAttribute
system call (other attributes are using this too).
Great, thanks for investigating! Do you think it's worth supporting insider builds in this example? Or will you wait until 20H1 release and update the example then?
@davidhewitt Sorry, I removed support for insider builds. Because it's difficult to maintain compatibility.
It now using SetWindowCompositionAttribute
to set dark title bar, which should work on newer insiders.
Thanks for the example code, very useful!
I'm on windows insiders fast ring (currently build 19023). The following line appears to no longer work on my system:
https://github.com/ysc3839/win32-darkmode/blob/ed8480f1c98cf4c3193babde9c342d0aae1bdbf5/win32-darkmode/DarkMode.h#L77
What I've found (through a bit of experimentation) is that the constant
19
needs to instead be20
on my system. If I change that line accordingly, then this example works as expected on my system.I guess a build version check might be needed and switch the constant at runtime accordingly?