From 3f91e7529a37e50a48f21c0c3cb75c47bf3da36a Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Sat, 2 Dec 2006 18:12:07 -0700 Subject: [PATCH] comctl32: Destroy header information on WM_NCDESTROY instead of WM_DESTROY. --- dlls/comctl32/header.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 5b62ddae3bd..73b10950a26 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1501,11 +1501,18 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + HTHEME theme = GetWindowTheme(hwnd); + CloseThemeData(theme); + return 0; +} + +static LRESULT +HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_ITEM *lpItem; INT nItem; - HTHEME theme; if (infoPtr->items) { lpItem = infoPtr->items; @@ -1519,13 +1526,11 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) Free(infoPtr->order); if (infoPtr->himl) - ImageList_Destroy (infoPtr->himl); + ImageList_Destroy (infoPtr->himl); SetWindowLongPtrW (hwnd, 0, 0); Free (infoPtr); - theme = GetWindowTheme(hwnd); - CloseThemeData(theme); return 0; } @@ -2078,6 +2083,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: return HEADER_Destroy (hwnd, wParam, lParam); + case WM_NCDESTROY: + return HEADER_NCDestroy (hwnd, wParam, lParam); + case WM_ERASEBKGND: return 1;