CloseThemeData function (uxtheme.h)

Closes the theme data handle.

Syntax

HRESULT CloseThemeData(
  [in] HTHEME hTheme
);

Parameters

[in] hTheme

Type: HTHEME

Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The CloseThemeData function should be called when a window that has a visual style applied is destroyed. This function should also be called whenever a window receives a WM_THEMECHANGED message. This call should be followed by an attempt to create a new theme data handle if a call to the IsThemeActive function returns TRUE.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header uxtheme.h
Library UxTheme.lib
DLL UxTheme.dll

See also

OpenThemeData