tooltips: handle the notification window properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog
    Make tooltips send its notifications to the parent window passed
    to it in CREATESTRUCT.  Based on a treeview patch by Igor Grahek.

Index: dlls/comctl32/tooltips.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/tooltips.c,v
retrieving revision 1.60
diff -u -r1.60 tooltips.c
--- dlls/comctl32/tooltips.c	22 Sep 2003 21:32:33 -0000	1.60
+++ dlls/comctl32/tooltips.c	19 Nov 2003 04:38:26 -0000
@@ -1902,12 +1902,11 @@
 
 
 static LRESULT
-TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
+TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
 {
     TOOLTIPS_INFO *infoPtr;
     NONCLIENTMETRICSA nclm;
     INT nResult;
-    HWND hParent;
 
     /* allocate memory for info structure */
     infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO));
@@ -1930,21 +1929,16 @@
 
     TOOLTIPS_SetDelayTime(hwnd, TTDT_AUTOMATIC, 0L);
 
-    hParent = GetParent(hwnd);
-    if (hParent) {
-        nResult = (INT) SendMessageA (hParent, WM_NOTIFYFORMAT,
+    nResult = (INT) SendMessageA (lpcs->hwndParent, WM_NOTIFYFORMAT,
 				  (WPARAM)hwnd, (LPARAM)NF_QUERY);
-        if (nResult == NFR_ANSI) {
-            infoPtr->bNotifyUnicode = FALSE;
+    if (nResult == NFR_ANSI) {
+        infoPtr->bNotifyUnicode = FALSE;
 	TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
-        }
-        else if (nResult == NFR_UNICODE) {
-	    infoPtr->bNotifyUnicode = TRUE;
-	    TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
-        }
-        else {
-	    ERR (" -- WM_NOTIFYFORMAT returns: error!\n");
-        }
+    } else if (nResult == NFR_UNICODE) {
+        infoPtr->bNotifyUnicode = TRUE;
+	TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
+    } else {
+        TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
     }
 
     SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE);
@@ -2371,7 +2365,7 @@
 
 
 	case WM_CREATE:
-	    return TOOLTIPS_Create (hwnd, wParam, lParam);
+	    return TOOLTIPS_Create (hwnd, (LPCREATESTRUCTW)lParam);
 
 	case WM_DESTROY:
 	    return TOOLTIPS_Destroy (hwnd, wParam, lParam);


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux