Commit 6204bbc3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/comboex: Remove child windows subclass on window destruction.

parent 69d90522
...@@ -1502,10 +1502,10 @@ static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr) ...@@ -1502,10 +1502,10 @@ static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr)
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr) static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
{ {
if (infoPtr->hwndCombo) if (infoPtr->hwndCombo)
RemoveWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID); SetWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID, 0);
if (infoPtr->hwndEdit) if (infoPtr->hwndEdit)
RemoveWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID); SetWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID, 0);
COMBOEX_FreeText (&infoPtr->edit); COMBOEX_FreeText (&infoPtr->edit);
COMBOEX_ResetContent (infoPtr); COMBOEX_ResetContent (infoPtr);
...@@ -1668,7 +1668,11 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1668,7 +1668,11 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
TRACE("hwnd=%p msg=%x wparam=%lx lParam=%lx, info_ptr=%p\n", TRACE("hwnd=%p msg=%x wparam=%lx lParam=%lx, info_ptr=%p\n",
hwnd, uMsg, wParam, lParam, infoPtr); hwnd, uMsg, wParam, lParam, infoPtr);
if (!infoPtr) return 0; if (uMsg == WM_NCDESTROY)
RemoveWindowSubclass(hwnd, COMBOEX_EditWndProc, EDIT_SUBCLASSID);
if (!infoPtr)
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
switch (uMsg) switch (uMsg)
{ {
...@@ -1823,11 +1827,14 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1823,11 +1827,14 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
TRACE("hwnd=%p msg=%x wparam=%lx lParam=%lx, info_ptr=%p\n", TRACE("hwnd=%p msg=%x wparam=%lx lParam=%lx, info_ptr=%p\n",
hwnd, uMsg, wParam, lParam, infoPtr); hwnd, uMsg, wParam, lParam, infoPtr);
if (!infoPtr) return 0; if (uMsg == WM_NCDESTROY)
RemoveWindowSubclass(hwnd, COMBOEX_ComboWndProc, COMBO_SUBCLASSID);
if (!infoPtr)
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
switch (uMsg) switch (uMsg)
{ {
case WM_DRAWITEM: case WM_DRAWITEM:
/* /*
* The only way this message should come is from the * The only way this message should come is from the
...@@ -1835,7 +1842,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1835,7 +1842,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
* that ComboEx knows this is listbox. * that ComboEx knows this is listbox.
*/ */
((DRAWITEMSTRUCT *)lParam)->itemState |= ODS_COMBOEXLBOX; ((DRAWITEMSTRUCT *)lParam)->itemState |= ODS_COMBOEXLBOX;
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
hDC = (HDC) wParam; hDC = (HDC) wParam;
...@@ -1844,7 +1851,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1844,7 +1851,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect)); TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0); ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc); SetBkColor (hDC, obkc);
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
case WM_SETCURSOR: case WM_SETCURSOR:
/* /*
...@@ -1858,7 +1865,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1858,7 +1865,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
nmmse.pt.y = 0; nmmse.pt.y = 0;
nmmse.dwHitInfo = lParam; nmmse.dwHitInfo = lParam;
COMBOEX_Notify (infoPtr, NM_SETCURSOR, (NMHDR *)&nmmse); COMBOEX_Notify (infoPtr, NM_SETCURSOR, (NMHDR *)&nmmse);
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
GetClientRect (hwnd, &rect); GetClientRect (hwnd, &rect);
...@@ -1868,15 +1875,15 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1868,15 +1875,15 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
pt.x = (short)LOWORD(lParam); pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam); pt.y = (short)HIWORD(lParam);
if (PtInRect(&rect, pt)) if (PtInRect(&rect, pt))
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
infoPtr->flags |= WCBE_MOUSECAPTURED; infoPtr->flags |= WCBE_MOUSECAPTURED;
SetCapture(hwnd); SetCapture(hwnd);
break; return 0;
case WM_LBUTTONUP: case WM_LBUTTONUP:
if (!(infoPtr->flags & WCBE_MOUSECAPTURED)) if (!(infoPtr->flags & WCBE_MOUSECAPTURED))
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
ReleaseCapture(); ReleaseCapture();
infoPtr->flags &= ~WCBE_MOUSECAPTURED; infoPtr->flags &= ~WCBE_MOUSECAPTURED;
...@@ -1885,7 +1892,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1885,7 +1892,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
} else { } else {
SendMessageW(hwnd, CB_SHOWDROPDOWN, TRUE, 0); SendMessageW(hwnd, CB_SHOWDROPDOWN, TRUE, 0);
} }
break; return 0;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if ( (infoPtr->flags & WCBE_MOUSECAPTURED) && if ( (infoPtr->flags & WCBE_MOUSECAPTURED) &&
...@@ -1894,7 +1901,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1894,7 +1901,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
COMBOEX_NotifyDragBegin(infoPtr, edit_text); COMBOEX_NotifyDragBegin(infoPtr, edit_text);
infoPtr->flags |= WCBE_MOUSEDRAGGED; infoPtr->flags |= WCBE_MOUSEDRAGGED;
} }
return DefSubclassProc(hwnd, uMsg, wParam, lParam); break;
case WM_COMMAND: case WM_COMMAND:
switch (HIWORD(wParam)) { switch (HIWORD(wParam)) {
...@@ -1975,9 +1982,10 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1975,9 +1982,10 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
break; break;
}/* fall through */ }/* fall through */
default: default:
return DefSubclassProc(hwnd, uMsg, wParam, lParam); ;
} }
return 0;
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment