Commit 94f74144 authored by Louis Philippe Gagnon's avatar Louis Philippe Gagnon Committed by Alexandre Julliard

When unsubclassing tools, use toolPtr->hwnd instead of toolPtr->uId if

toolPtr->flags does not contain TTF_IDISHWND (meaning uId is not a valid window handle).
parent 39ee3d4c
...@@ -863,9 +863,9 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -863,9 +863,9 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
(LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass); (LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass);
if (lpttsi) { if (lpttsi) {
if (lpttsi->uRefCount == 1) { if (lpttsi->uRefCount == 1) {
SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC, SetWindowLongA ((HWND)toolPtr->hwnd, GWL_WNDPROC,
(LONG)lpttsi->wpOrigProc); (LONG)lpttsi->wpOrigProc);
RemovePropA ((HWND)toolPtr->uId, COMCTL32_aSubclass); RemovePropA ((HWND)toolPtr->hwnd, COMCTL32_aSubclass);
COMCTL32_Free (&lpttsi); COMCTL32_Free (&lpttsi);
} }
else else
...@@ -950,9 +950,9 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -950,9 +950,9 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
(LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass); (LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass);
if (lpttsi) { if (lpttsi) {
if (lpttsi->uRefCount == 1) { if (lpttsi->uRefCount == 1) {
SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC, SetWindowLongA ((HWND)toolPtr->hwnd, GWL_WNDPROC,
(LONG)lpttsi->wpOrigProc); (LONG)lpttsi->wpOrigProc);
RemovePropA ((HWND)toolPtr->uId, COMCTL32_aSubclass); RemovePropA ((HWND)toolPtr->hwnd, COMCTL32_aSubclass);
COMCTL32_Free (&lpttsi); COMCTL32_Free (&lpttsi);
} }
else else
...@@ -1973,22 +1973,29 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1973,22 +1973,29 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
/* remove subclassing */ /* remove subclassing */
if (toolPtr->uFlags & TTF_SUBCLASS) { if (toolPtr->uFlags & TTF_SUBCLASS) {
LPTT_SUBCLASS_INFO lpttsi; LPTT_SUBCLASS_INFO lpttsi;
if (toolPtr->uFlags & TTF_IDISHWND) if (toolPtr->uFlags & TTF_IDISHWND) {
lpttsi = (LPTT_SUBCLASS_INFO)GetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass); lpttsi = (LPTT_SUBCLASS_INFO)GetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass);
else if (lpttsi) {
lpttsi = (LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass); SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC,
(LONG)lpttsi->wpOrigProc);
if (lpttsi) { RemovePropA ((HWND)toolPtr->uId, COMCTL32_aSubclass);
SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC, COMCTL32_Free (&lpttsi);
(LONG)lpttsi->wpOrigProc); }
RemovePropA ((HWND)toolPtr->uId, COMCTL32_aSubclass); }
COMCTL32_Free (&lpttsi); else {
} lpttsi = (LPTT_SUBCLASS_INFO)GetPropA (toolPtr->hwnd, COMCTL32_aSubclass);
} if (lpttsi) {
} SetWindowLongA ((HWND)toolPtr->hwnd, GWL_WNDPROC,
(LONG)lpttsi->wpOrigProc);
RemovePropA ((HWND)toolPtr->hwnd, COMCTL32_aSubclass);
COMCTL32_Free (&lpttsi);
}
}
}
}
COMCTL32_Free (infoPtr->tools); COMCTL32_Free (infoPtr->tools);
} }
......
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