如何检索的Windows的主题颜色? [英] How do I retrieve the theme colour of Windows?

查看:124
本文介绍了如何检索的Windows的主题颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一种方式来获得用户的Windows主题与WPF或C#代码隐藏的主题颜色。而这个颜色我的意思是可以的 Personalization\Window颜色设置的一个,外观的在Windows 7下(和Vista也一样,我认为)。我想用这个颜色,使一个梯度高达5的Trillian做同样的方式。

I would like to have a way to get the theme colour of the users Windows theme with WPF or C# code-behind. And with this colour I mean the one that can be set in Personalization\Window Color and Appearance under Windows 7(and Vista too, I think). I want to use this colour to make a gradient in much the same way as Trillian 5 does it.

我试图找到它自己,但不幸的是我没有在任何地方获得。显然,这不是在 SystemColors.Whatever 。我找到的东西在 MSDN 但我无法弄清楚如何使用它,我也不认为这是我想要的。

I tried to find it myself, but unfortunately I'm not getting anywhere. Apparently it's not under SystemColors.Whatever. I have found something on the MSDN but I can't figure out how to use it, nor do I think it's what I want.

如果有人可以帮助我,我将不胜感激。

If anyone could help me I would be grateful.

推荐答案

我觉得 DwmGetColorizationColor http://msdn.microsoft.com/en-us/library/aa969513.aspx )是你在找什么;你需要的P / Invoke。

I think DwmGetColorizationColor (http://msdn.microsoft.com/en-us/library/aa969513.aspx) is what you're looking for; you'll need to P/Invoke.

这篇关于如何检索的Windows的主题颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆