简体   繁体   English

如何在Windows 8.1上获取活动的窗口标题颜色笔刷?

[英]How to get the active window title color brush on Windows 8.1?

I'm trying to get a brush with the system color of an active window, or this blue color off my Windows 8.1 for example: 我正在尝试使用活动窗口的系统颜色作为画笔,或者使用Windows 8.1的蓝色作为示例:

在此处输入图片说明

So I do this: 所以我这样做:

HANDLE hBrush = GetSysColorBrush(COLOR_ACTIVECAPTION);

But the color that brush gives me is this: 但是刷子给我的颜色是这样的:

在此处输入图片说明

Any idea what am I doing wrong here? 知道我在做什么错吗?

您可以尝试使用MSND的GetSysColor函数中记录的“ 0xA ”或“ COLOR_ACTIVEBORDER ”: GetSysColor函数

HANDLE hBrush = GetSysColorBrush(COLOR_ACTIVEBORDER);

Supposedly, DwmGetColorizationColor return this color value. 据说DwmGetColorizationColor返回此颜色值。

On Windows 7/Vista, it sounds like the situation was much more complicated due to the glass translucency effects: Vista/7: How to get glass color? 在Windows 7 / Vista上,由于玻璃的半透明效果,听起来情况要复杂得多: Vista / 7:如何获得玻璃颜色?

Since you're dealing with Windows 8.1, transparency is disabled, so this should provide the opaque color for the Window. 由于您使用的是Windows 8.1,因此禁用了透明度,因此这应该为Window提供不透明的颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM