Module _winxptheme
A module which provides an interface to the Windows XP
'theme' API.
Note that this module will fail to load on
non-Windows XP versions. Generally you should use the
'winxptheme' module which will load on all Windows
versions, and provide implementations of
IsThemeActive() or IsAppThemed() which return False when
XP is not used, and provides all objects from this module
when XP is used. See winxptheme.py for more details.
Methods
- OpenThemeData
- Open the theme data for the specified HWND and
semi-colon separated list of class names.
OpenThemeData() will try each class name, one at a time, and use the first matching theme info found. If a match is found, a theme handle to the data is returned. If no match is found, a "NULL" handle is returned.
When the window is destroyed or a WM_THEMECHANGED msg is received, _winxptheme::CloseThemeData should be called to close the theme handle. - CloseThemeData
- Closes the theme data handle. This should be done when the window being themed is destroyed or whenever a WM_THEMECHANGED msg is received (followed by an attempt to create a new Theme data handle).
- DrawThemeBackground
- Draws the theme-specified border and fill for the "iPartId" and "iStateId". This could be based on a bitmap file, a border and fill, or other image description.
- DrawThemeText
- Draws the text using the theme-specified color and font for the "iPartId" and "iStateId".
- GetThemeBackgroundContentRect
- Gets the size of the content for the theme-defined background. This is usually the area inside the borders or Margins.
- GetThemeBackgroundExtent
- Calculates the size/location of the theme- specified background based on the "pContentRect".
- IsThemeActive
- Can be used to test if a system theme is active
for the current user session.
use the API _winxptheme::IsAppThemed to test if a theme is active for the calling process. - IsAppThemed
- Returns True if a theme is active and available to the current process
- GetWindowTheme
- If window is themed, returns its most recent HTHEME from OpenThemeData() - otherwise, returns NULL.
- EnableThemeDialogTexture
- Enables/disables dialog background theme. This method can be used to tailor dialog compatibility with child windows and controls that may or may not coordinate the rendering of their client area backgrounds with that of their parent dialog in a manner that supports seamless background texturing.
- IsThemeDialogTextureEnabled
- Reports whether the dialog supports background texturing.
- GetThemeAppProperties
- Returns the app property flags that control theming
- EnableTheming
- Enables or disables themeing for the current user in the current and future sessions.
- SetWindowTheme
- Rredirects an existing Window to use a different section of the current theme information than its class normally asks for.
- GetCurrentThemeName
- Get the name of the current theme in-use, the canonical color scheme name (not the display name) and the canonical size name (not the display name).