Dark mode APIs RRS feed

  • Question

  • Hi,

    Does Microsoft plan to document and support the dark mode theming APIs recently added to Windows 10?


    DwmSetWindowAttribute with a DWMWINDOWATTRIBUTE of 0x13.

    uxtheme.dll's AllowDarkModeForApp (ordinal 135) and AllowDarkModeForWindow (ordinal 133).

    The ribbon properties UI_PKEY_DarkModeRibbon and UI_PKEY_ApplicationButtonColor.

    Wednesday, December 19, 2018 1:26 PM

All replies

  • Hi splidge,

    I'm not sure what's the plan of Microsoft. But, You could use it as the following:


    SetWindowTheme(hwnd, L"DarkMode_Explorer", NULL);


    using TYPE_AllowDarkModeForWindow = bool (WINAPI *)(HWND a_HWND, bool a_Allow);

    static const TYPE_AllowDarkModeForWindow AllowDarkModeForWindow = (TYPE_AllowDarkModeForWindow)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(133));

    AllowDarkModeForWindow(a_HWND, true);

    SetWindowTheme(hwnd, L"Explorer", NULL);

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 20, 2018 6:17 AM
  • Hello, Any Updates?
    Tuesday, February 12, 2019 9:19 AM
  • I've been banging my head on this all day, and SetWindowTheme only seems to work on a very select few controls, like buttons, split buttons, and scrollbars.

    Sunday, May 12, 2019 9:21 PM
  • The dark theme graphics is only implemented/designed for the few controls that are needed by Explorer windows and Open/Save dialog. Besides that, you are out of luck and need to draw everything yourself.
    Wednesday, May 15, 2019 1:01 AM