The CloseThemeData function closes the theme data handle, previously opened by OpenThemeData function.

The Theme parameter is a handle to a window's specified theme data.

Function returns S_OK if successful, or an error value otherwise.

Remarks

The CloseThemeData function should be called when a window that has a visual style applied is destroyed. Also this function is used when a window receives a WM_THEMECHANGED message followed by an attempt to create a new theme data handle.