OpenThemeData function
Return to Introduction  Previous page  Next page

function OpenThemeData(Wnd: hWnd; pszClassList: lpCWStr): hTheme;  

The OpenThemeData function opens the theme data for the specified window (the window handle should be specified in Wnd parameter) and semi-colon separated list of class names (pszClassList parameter).  
WndWindow handle of the control/window to be themed;  
pszClassListClass name (or list of names separated by semi-colon) to match to theme data section.  
Return value  
OpenThemeData tries to match each class, one at a time, to a class data section in the active theme. If a match is found, an associated HTHEME handle is returned. If no match is found NULL (nil) is returned.  
The pszClassList parameter contains a list, not just a single name, to provide the class an opportunity to get the best match between the class and the current visual style. For example, a button might pass L"OkButton, Button" if its ID=ID_OK. If the current visual style has an entry for OkButton, that is used, otherwise no visual style is applied.  

See also
IsXPThemeEnabled, CloseThemeData, DrawThemeBackground, DrawThemeParentBackground and DrawThemedControl functions.