Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How do I return the current windows "Style" within Windows XP?

How do I return the current windows "Style" within Windows XP?

Within Windows XP, a user may select the style of the Operating System, i.e. XP or Classic (win95/98). This may affect the way that
certain scripts execute and how objects are recognised, which can require a separate include file.

In order to aid the automation of selecting the correct include file, it is necessary to be able to determine which "style" is currently
loaded.

This can be achieved by querying a specific registry entry within the windows registry file.

The following script queries this entry and then determines which "style" is loaded based upon this data. The result is then printed for
the user i.e. Windows XP or Windows Classic.

[ ] //Code [ ] use "msw32.inc" [ ] [-] testcase WindowsStyle () appstate none [ ] //Get regvalue for reg entry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager [ ] //RegKye value for ThemeActive [ ] //ThemeActive is "1" if Windows XP, "0" if Windows Classic [ ] [ ] INTEGER iKey = HKEY_CURRENT_USER // defined in msw32.inc [ ] STRING sPath = "Software\Microsoft\Windows\CurrentVersion\ThemeManager" [ ] String sItem = "ThemeActive" [ ] String sCurrentTheme = "" [ ] [ ] [ ] String sRegValue = SYS_GetRegistryValue (iKey, sPath, sItem) [ ] //Print (SYS_GetRegistryValue (iKey, sPath, sItem)) [ ] [ ] Print(sRegValue) [ ] [-] if (sRegValue != null) [ ] [-] if (sRegValue == "1") [ ] //Return the theme [ ] sCurrentTheme = "Windows XP" [ ] [-] if (sRegValue == "0") [ ] //Return the Theme [ ] sCurrentTheme = "Windows Classic" [ ] [ ] Print(sCurrentTheme) [ ] //End Code

Old KB# 21178

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:17
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.