3

Here's a recurring problem I've had.

I love using a dark theme for my Windows 7 computer. Unfortunately, the only way to get a really dark theme is by choosing the "High Contrast Black" color style, even though I don't really want high contrast, just darkness.

My theme works great, except that once in a while, there's an app that shows terrible colors because of it. Chrome is one example. I managed to fight that off using the Forced Colors setting, but that setting may be removed in the future, and then I'll be in a big problem.

I'm guessing that each app has some kind of API to ask the operating system about the theme colors. Is there any way to intercept that call and change the data, so specific apps will think that I'm on a non-high contrast theme?

Other ideas and solutions would also be interesting to hear.

Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
  • 1
    It would probably be interesting to know what isn't satisfactory with W10 dark mode, and why just setting custom colors without setting the high contrast checkbox doesn't work well either. Back in W98 I had yellow text + dark blue background without setting high contrast and it worked well (since then I became blind, so all that is now totally useless for me). – QuentinC Mar 07 '22 at 05:27
  • I'm in Windows 7, not Windows 10. I haven't been able to find a dark theme that's truly dark without using High Contrast Black. Here's a screenshot of one of my monitors: https://i.imgur.com/pDuIAb5.jpg If you're able to find a Windows 7 theme that's as dark as mine, as convenient to use and doesn't use HCM, I'll consider that bounty-worthy. – Ram Rachum Mar 07 '22 at 08:59
  • Unfortunately I won't be able to help further in finding a suitable theme, I'm blind. For the actual question I don't know if it's possible. As far as I know, querying system settings like high contrast don't pass through windows messages, and so you can't put an hook on it (cf. SetWindowsHookEx) – QuentinC Mar 07 '22 at 12:16
  • Maybe you can have a look at screen magnifiers. You don't need magnification, but I know for example that ZoomText has also options to filter colors (something like smart color inversion). – QuentinC Mar 07 '22 at 12:20
  • I see. I'm wary of having all the video information of my usage go through a program. But I'll keep it in mind if I can't find a better solution. – Ram Rachum Mar 07 '22 at 12:23
  • It looks like you're using the High Contrast theme? (As opposed to a custom `.msstyles`)? – Dai Mar 12 '22 at 18:35
  • "I'm guessing that each app has some kind of API to ask the operating system about the theme colors.": There is `DwmGetColorizationColor` but that only applies when you have _Aero Glass_ enabled (which you don't), so that's irrelevant. While every version of Windows does allow applications to detect "High Contrast mode", most apps look awful - **there is no way around that** - and it wasn't until recent versions of Windows 10 that "Light/Dark-mode" was made an exposed feature, but Win10 Dark Mode is _nothing like_ High Contrast mode: they're very, very different things. – Dai Mar 12 '22 at 18:36
  • My point is, you seem to be thinking that High Contrast mode is the same thing as Dark Mode. It isn't. And you should stop pretending that it is. – Dai Mar 12 '22 at 18:41
  • It looks like Chrome's light vs dark mode depends on the registry key `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize`, key `AppsUseLightTheme`. It looks like high-contrast uses `SystemParametersInfo` with `SPI_GETHIGHCONTRAST`, masking for `HCF_HIGHCONTRASTON`. See `chromium/src/native_theme/native_theme.cc` and `native_theme_win.cc`. – Solomon Ucko Mar 13 '22 at 17:34
  • Thank you for this Solomon. Saving that info in case I'll ever try to hack it. – Ram Rachum Mar 13 '22 at 17:51
  • You're welcome. I also just came across this relevant blog post: https://devblogs.microsoft.com/oldnewthing/20081203-00/?p=19983 – Solomon Ucko Mar 15 '22 at 15:10

0 Answers0