Visual styles can be enabled in an application by calling the EnableVisualStyles method or by using an application manifest that specifies that ComCtl32.dll version 6 or later will be used to draw controls. Visual styles are enabled in the application To verify this condition separately, use the IsEnabledByUser property of the VisualStyleInformation class. The user has enabled visual styles in the operating system To verify this condition separately, use the IsSupportedByOS property of the VisualStyleInformation class. The operating system supports visual styles The following table lists the four conditions that must exist for RenderWithVisualStyles to return true. Other languages are quite similar.Īs I don't like either PInvokes nor the registry access, which requires additional security trust, I came accross this interesting part of documentation of Application.RenderWithVisualStyles property - which I believe should return the thing you want:
#Themes for windows xp code
The following C# code illustrates reading the settings. (All of these data values are type REG_SZ, or strings, by the way.) If ThemeActive is "1", ColorName will be "NormalColor" for blue, "HomeStead" for olive green, or "Metallic" for silver.
#Themes for windows xp windows
ThemeActive is "1" if Windows XP, "0" if Windows Classic. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager
![themes for windows xp themes for windows xp](https://wallpapertag.com/wallpaper/full/1/0/4/621336-widescreen-windows-xp-backgrounds-1920x1200-hd-1080p.jpg)
To save you experimenting, I'll just tell you: The answer is found in the registry, but it's not obvious. I still can't find an easy way to get UxTheme to tell me whether the user has chosen Blue, Green, or Silver. I revised the code to illustrate Konrad's suggestion of calling UxTheme's IsThemeActive() method and Rene's IsAppThemed().
![themes for windows xp themes for windows xp](http://www.newdesignfile.com/postpic/2009/02/windows-xp-desktop-themes-free-download_301306.png)
That's an important disclaimer, along with this: Do not modify the registry hoping to change the theme. Thanks to Konrad Windszus and Rene Koenig, who point out that peeking in the registry is brittle and likely to break in future versions. The user can choose "Windows Classic" or "Windows XP." If they choose the latter, they can select Blue (the default), Olive Green, or Silver color schemes. Because there are only four, at least right now, it is feasible to write code that reacts to the user's choice of theme. I choose not to mess with UxTheme and the like, but I would like my applications to be aware when themes are in use. Microsoft refuses to open themes to developers for fear rampant new themes will cause "application incompatibilities." Support for XP Themes is known to be somewhat haphazard - the Explorer bypasses the theme DLL, UxTheme, for example.