diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index 10f1b8c1e1a..8053accb36f 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -250,6 +250,7 @@ static inline void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to) } extern void THEMING_Initialize(void); +extern void THEMING_Uninitialize(void); extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM); extern void THEMING_SetSubclassData(HWND, ULONG_PTR); diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 13e483d2b3d..629fe084b62 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -150,6 +150,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; case DLL_PROCESS_DETACH: + /* clean up subclassing */ + THEMING_Uninitialize(); + /* unregister all common control classes */ ANIMATE_Unregister (); COMBOEX_Unregister (); diff --git a/dlls/comctl32/theming.c b/dlls/comctl32/theming.c index a03b641e684..ff7570c53d8 100644 --- a/dlls/comctl32/theming.c +++ b/dlls/comctl32/theming.c @@ -146,6 +146,20 @@ void THEMING_Initialize (void) } } +/*********************************************************************** + * THEMING_Uninitialize + * + * Unregister shadow classes for standard controls. + */ +void THEMING_Uninitialize (void) +{ + int i; + for (i = 0; i < NUM_SUBCLASSES; i++) + { + UnregisterClassW (subclasses[i].className, NULL); + } +} + /*********************************************************************** * THEMING_CallOriginalClass *