暗模式API [英] Dark mode APIs
问题描述
Microsoft是否计划记录并支持最近添加到Windows 10的暗模式主题API?
Does Microsoft plan to document and support the dark mode theming APIs recently added to Windows 10?
ie
DwmSetWindowAttribute, DWMWINDOWATTRIBUTE为0x13。
DwmSetWindowAttribute with a DWMWINDOWATTRIBUTE of 0x13.
uxtheme.dll的AllowDarkModeForApp (序号135)和AllowDarkModeForWindow(序号133)。
功能区属性 UI_PKEY_DarkModeRibbon和  ; UI_PKEY_ApplicationButtonColor。
推荐答案
嗨splidge,
我不确定是什么微软的计划。但是,你可以使用它如下:
Hi splidge,
I'm not sure what's the plan of Microsoft. But, You could use it as the following:
1。
SetWindowTheme(hwnd, L"DarkMode_Explorer", NULL);
2。
2.
using TYPE_AllowDarkModeForWindow = bool (WINAPI *)(HWND a_HWND, bool a_Allow);
static const TYPE_AllowDarkModeForWindow AllowDarkModeForWindow =(TYPE_AllowDarkModeForWindow)GetProcAddress(hUxtheme,MAKEINTRESOURCEA(133));
static const TYPE_AllowDarkModeForWindow AllowDarkModeForWindow = (TYPE_AllowDarkModeForWindow)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(133));
AllowDarkModeForWindow(a_HWND,true);
AllowDarkModeForWindow(a_HWND, true);
SetWindowTheme(hwnd,L" Explorer",NULL);
SetWindowTheme(hwnd, L"Explorer", NULL);
< p style ="border:none; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; outline:0px; padding-right:0px; color:#454545; font-size :14px">
最好的问候,
Drake
Drake
这篇关于暗模式API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!