获取Windows主题? [英] Get Windows theme?

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

问题描述

我必须真正了解它的Windows主题我的用户使用。
更多precisely,经典,XP,基本还是航空。 (基本主题,在Vista / 7系统的Windows基本主题)
我已经知道如何找到,如果它是航空,但如何对别人?

I must really know which Windows theme my user is using.
More precisely, Classic, XP, Basic or Aero. (Basic theme as in Vista/7 Windows Basic theme)
I already know how to find if it's aero, but how about the others?

答案可以在任何.NET语言(C#,VB.NET或C ++)。

The answer can be in any .NET language (C#, VB.NET or C++).

如果你真的要知道为什么在地球上,我需要知道的主题,那么在这里你去:
我有过一个窗体的标题一定的浮动按钮,我需要根据Windows主题,以改变其外观。
到目前为止,我设法找到航空/经典。

If you really have to know why on Earth I need to know the theme then here you go:
I have some floating buttons over the caption of a form and I need to change their appearance according to the windows theme.
So far I've managed to find Aero/Classic.

结果的屏幕截图,解决问题后:

Screen shots of the result, after solving the issue:

推荐答案

您可以检查主题是否处于活动状态调用的 IsAppThemed /的 IsThemeActive ,然后通过调用的 DwmIsCompositionEnabled 。有可能是这样做的其他方式!

You can check whether themes are active by calling IsAppThemed/IsThemeActive and then check for Aero by calling DwmIsCompositionEnabled. There may well be other ways of doing this!!

修改

的逻辑是:

  1. 我可以导入 IsAppThemed IsThemeActive ?如果没有那我一定是在Windows经典(Win9x的或Win2k的)。
  2. 这是什么 IsAppThemed和IsThemeActive 返回?如果为假,则我必须在Windows经典。
  3. 我可以导入 DwmIsCompositionEnabled ?如果没有那我一定是XP的主题。
  4. 这是什么 DwmIsCompositionEnabled 的回报?如果为真,那么我是航空,不然我的Windows基础。
  1. Can I import IsAppThemed and IsThemeActive? If no then I must be in Windows Classic (Win9x or Win2k).
  2. What does IsAppThemed and IsThemeActive return? If false then I must be in Windows Classic.
  3. Can I import DwmIsCompositionEnabled? If no then I must be XP themed.
  4. What does DwmIsCompositionEnabled return? If true then I am Aero, otherwise I am Windows Basic.

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

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