Get a Windows theme?

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


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


If you really need to know why on Earth I need to know a topic, here you go:
I have several floating buttons above the form heading, and I need to change their appearance to fit the windows theme.
So far I have managed to find Aero / Classic.


Screenshots of the result, after solving the problem: Minimize to tray button

+3
source share
2

, , IsAppThemed/IsThemeActive, Aero, DwmIsCompositionEnabled. !

:

  • IsAppThemed IsThemeActive? , Windows Classic (Win9x Win2k).
  • IsAppThemed and IsThemeActive? false, Windows Classic.
  • DwmIsCompositionEnabled? , XP themed.
  • DwmIsCompositionEnabled? true, Aero, Windows Basic.
+2

:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes

"CurrentTheme", . #.

using Microsoft.Win32;

public string GetTheme()
{
  string RegistryKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes";
  string theme;
  theme = (string) Registry.GetValue(RegistryKey, "CurrentTheme", string.Empty);
  theme = theme.Split('\\').Last().Split('.').First().ToString();
  return theme;
}
+3

Source: https://habr.com/ru/post/1781047/


All Articles