tags:

views:

1276

answers:

3

Hi Everybody, I'm trying to call the OpenThemeData (see msdn OpenThemeData) function but I couldn't determine what are the acceptable Class names to be passed in by the "pszClassList" parameter.

HTHEME OpenThemeData(      
 HWND hwnd,
 LPCWSTR pszClassList
);

Could anybody tell me what are the acceptable class names that I can pass into that parameter? Thanks!

+1  A: 

Class names depend on the theme. For example, as the documentation for OpenThemeData states:

Class names for the Aero theme are defined in AeroStyle.xml, which is found in the Include folder of the Microsoft Windows Software Development Kit (SDK).

Franci Penov
Thank you for the info, I'll give that a shot :).
Lirik
+1  A: 

You can look in "AeroStyle.xml" as a previous poster noted, which gives an exact list for Vista/Aero. However, if you want to play safe (and you probably do) the class names should, in general, be Windows class names of Windows common controls. For example, push buttons and check boxes use the class name "Button", the edit control "Edit", etc. I generally pick the class name of the control that's closest to whatever custom element I'm working on is, and use the theme data for that. That way you'll get code that works with XP, Vista and (hopefully) Windows 7, regardless of what the user's selected theme actually is.

However, unless you use raw Win32 a lot, you probably don't do much control creation directly using the class name. The class names are rather liberally sprinkled throughout MSDN. A good place to start is usually the "CommCtrl.h" file from the Platform SDK, which has a lot of them, and they're always described in the MSDN help on the individual common controls. You can also often learn them by looking at how dialogs are defined in .rc files by opening them in a text editor: these contain the class name for the controls.

Thank you for the info, I'll give that a shot :).
Lirik
A: 

It has nothing to do with Aero, which even doesn't exits on XP ! See the source code of OpenThemeData()..

Aero was given as an example where to look for more info on the various class names supported by themes. You should not imply connection where none was specified.
Franci Penov