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

[feature request] native windows dark mode system menu #4750

Open
emako opened this issue Jan 4, 2025 · 0 comments
Open

[feature request] native windows dark mode system menu #4750

emako opened this issue Jan 4, 2025 · 0 comments

Comments

@emako
Copy link

emako commented Jan 4, 2025

Why not using UxTheme #135 for dark mode if OS version >= Windows 10 Version 1809 (Build 17763)?

enum PreferredAppMode { Default = 0, Dark = 1, Light = 2 };
typedef int(WINAPI* SetPreferredAppMode_t)(PreferredAppMode preferredAppMode);

HMODULE hModule = LoadLibrary(L"uxtheme.dll");
if (hModule != NULL) {
    SetPreferredAppMode_t SetPreferredAppMode =
        (SetPreferredAppMode_t)GetProcAddress(hModule, MAKEINTRESOURCEA(135)); // Loading the #135 API
    SetPreferredAppMode(PreferredAppMode::Dark);
    if (SetPreferredAppMode == NULL) {
        FreeLibrary(hModule);
    }
}

Renderings like

image (Because the selected darker theme will be overwritten, the screenshot under light is used here.)

instead of

image
@emako emako changed the title [feature request] dark mode menu [feature request] native windows dark mode system menu Jan 4, 2025
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

1 participant