Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShouldAppsUseDarkMode is incorrect on Win10 1903+ #3

Open
henrypp opened this issue Dec 6, 2019 · 3 comments
Open

ShouldAppsUseDarkMode is incorrect on Win10 1903+ #3

henrypp opened this issue Dec 6, 2019 · 3 comments

Comments

@henrypp
Copy link

henrypp commented Dec 6, 2019

fnShouldAppsUseDarkMode // 132

returned inncorrect result on Win10 1903+, you should call:

fnShouldSystemUseDarkMode // 138

ps: also for x64 builds right way for set properties of BOOL (INT) is:

SetPropW(hWnd, L"UseImmersiveDarkModeColors", (HANDLE)(LONG_PTR)dark);
@oltolm
Copy link

oltolm commented Aug 13, 2023

ShouldAppsUseDarkMode works at least on 22H2 (19045.3324). I tested it myself.

@Chaoses-Ib
Copy link

On Windows 11 23H2 (22631.3085), ShouldAppUseDarkMode() always returns true regardless of what system mode and app mode are:

image

image

image

image

I guess someone in Windows really likes dark mode.

@axoroll7
Copy link

axoroll7 commented Oct 12, 2024

Instead of ShouldAppsUseDarkMode, I use :
Registry key : Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme.
OR Brightness with WinRT (only the Windows 10 SDK is needed, not C++/WinRT) :

#include <iostream>
#include <winrt/Windows.UI.ViewManagement.h>
auto uisettings = winrt::Windows::UI::ViewManagement::UISettings();
auto color = uisettings.GetColorValue(winrt::Windows::UI::ViewManagement::UIColorType::Foreground);
bool isbright = (0.299 * color.R + 0.587 * color.G + 0.114 * color.B) < 127.5;
std::cout << "isbright: " << isbright << std::endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants