From d834e4c85883e03820da171586abb5394b08e37b Mon Sep 17 00:00:00 2001
From: Gerard Patel <gerard.patel@asi.fr>
Date: Tue, 9 Jan 2001 20:50:13 +0000
Subject: [PATCH] Send the creation notification to the true owner of the
 tooltip.

---
 dlls/comctl32/commctrl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 1689298567f..2acf7b37edd 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -1210,14 +1210,15 @@ COMCTL32_CreateToolTip(HWND hwndOwner)
     if (hwndToolTip)
     {
 	NMTOOLTIPSCREATED nmttc;
-
-	nmttc.hdr.hwndFrom = hwndOwner;
-	nmttc.hdr.idFrom = GetWindowLongA(hwndOwner, GWL_ID);
+        /* true owner can be different if hwndOwner is a child window */
+        HWND hwndTrueOwner = GetWindow(hwndToolTip, GW_OWNER);
+        nmttc.hdr.hwndFrom = hwndTrueOwner;
+        nmttc.hdr.idFrom = GetWindowLongA(hwndTrueOwner, GWL_ID);
 	nmttc.hdr.code = NM_TOOLTIPSCREATED;
 	nmttc.hwndToolTips = hwndToolTip;
 
-	SendMessageA(GetParent(hwndOwner), WM_NOTIFY,
-		     (WPARAM)GetWindowLongA(hwndOwner, GWL_ID),
+       SendMessageA(GetParent(hwndTrueOwner), WM_NOTIFY,
+                    (WPARAM)GetWindowLongA(hwndTrueOwner, GWL_ID),
 		     (LPARAM)&nmttc);
     }
 
-- 
GitLab