Using Theme Subclasses
Theme classes that represent controls such as ComboBox, Edit, ExplorerBar, Rebar, Tab, and Toolbar can be subclassed in order to provide theme variations for that particular control. For example, the Button class is subclassed as Start::Button
in order to provide control over the theme applied to the Start button.
Note
Use caution when you create subclasses like those that are discussed in this topic. Because subclasses might be altered or unavailable in subsequent versions of Windows, you are discouraged from using them.
Two Ways to Use a Theme Subclass
An application can use a subclassed theme in one of these two ways:
- It can use the OpenThemeData function with a string of the form
subclass::class
in the pszClassList parameter. - It can call SetWindowTheme with the theme subclass name in the pszSubAppName parameter.
Using Theme Messages That Set Visual Style
Certain controls, such as Rebar and Toolbar, provide specific messages that you can send to instruct the control to use a theme subclass. For those controls, provide a pointer to a buffer that contains the theme subclass name in the lParam parameter of the message. Use the generic CCM_SETWINDOWTHEME message, or use a specific variant like those shown in the following table.
Control | Message |
---|---|
Tooltip | TTM_SETWINDOWTHEME |
Toolbar | TB_SETWINDOWTHEME |
Rebar | RB_SETWINDOWTHEME |
ComboBoxEx | CBEM_SETWINDOWTHEME |
The following table lists some of the subclasses that Windows Vista defines.
Class | Subclasses |
---|---|
ComboBox |
|
Edit |
|
Rebar |
|
Tab |
|
Toolbar |
|
Internet Explorer Subclasses
In Windows Vista, the subclasses of certain classes internal to Windows Internet Explorer and Windows Explorer are available even though the classes themselves are not. The following table lists the available subclasses.
Class | Subclass |
---|---|
AddressBand |
|
SearchBox |
|
The following table shows the specifics of these classes.
Control | Part | States |
---|---|---|
ADDRESSBAND | ABBACKGROUND | NORMAL (0x1), HOT (0x2), DISABLED (0x3), FOCUSED (0x4) |
SEARCHBOX | SBBACKGROUND | NORMAL (0x1), HOT (0x2), DISABLED (0x3), FOCUSED (0x4) |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for