patch from Physicus, implement TOOLTIPS_NotifyFormat, it now retrurn the type of...
authorMagnus Olsen <magnus@greatlord.com>
Mon, 12 Feb 2007 18:37:05 +0000 (18:37 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Mon, 12 Feb 2007 18:37:05 +0000 (18:37 +0000)
before it did not return any type at all. it did a heap crash from downloader mangers when it try figout what type
of sting the toolstips use. it is tested in 0.3.1 and not whole implemnent is tested yet. it should be right for all
case.

svn path=/trunk/; revision=25794

reactos/dll/win32/comctl32/comctl32_ros.diff
reactos/dll/win32/comctl32/tooltips.c

index aa33052..3806754 100644 (file)
@@ -107,3 +107,43 @@ Index: propsheet.c
      case WM_SYSCOLORCHANGE:
        COMCTL32_RefreshSysColors();
        return FALSE;
+
+Index: tooltips.c
+===================================================================
+--- tooltips.c (revision 25790)
++++ tooltips.c (working copy)
+@@ -2450,7 +2450,34 @@
+ TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
+ {
+     FIXME ("hwnd=%p wParam=%x lParam=%lx\n", hwnd, wParam, lParam);
++    TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
++    TTTOOL_INFO *toolPtr = infoPtr->tools;
++    INT nResult;
++    if (lParam == NF_QUERY)
++    {
++        if (toolPtr->bNotifyUnicode)
++        {
++            return NFR_UNICODE;
++        } else {
++            return NFR_ANSI;
++        }
++    }
++    else if (lParam == NF_REQUERY)
++    {
++        nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
++                    (WPARAM)hwnd, (LPARAM)NF_QUERY);
++        if (nResult == NFR_ANSI) {
++            toolPtr->bNotifyUnicode = FALSE;
++        TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
++        } else if (nResult == NFR_UNICODE) {
++            toolPtr->bNotifyUnicode = TRUE;
++        TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
++        } else {
++            TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
++        }
++        return nResult;
++    }
+     return 0;
+ }
\ No newline at end of file
index a05d8a5..394cd64 100644 (file)
@@ -2450,7 +2450,34 @@ static LRESULT
 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
     FIXME ("hwnd=%p wParam=%x lParam=%lx\n", hwnd, wParam, lParam);
+    TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
+    TTTOOL_INFO *toolPtr = infoPtr->tools;
+    INT nResult;
 
+    if (lParam == NF_QUERY)
+    {
+        if (toolPtr->bNotifyUnicode)
+        {
+            return NFR_UNICODE;
+        } else {
+            return NFR_ANSI;
+        }
+    }
+    else if (lParam == NF_REQUERY)
+    {
+        nResult = (INT) SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
+                    (WPARAM)hwnd, (LPARAM)NF_QUERY);
+        if (nResult == NFR_ANSI) {
+            toolPtr->bNotifyUnicode = FALSE;
+        TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
+        } else if (nResult == NFR_UNICODE) {
+            toolPtr->bNotifyUnicode = TRUE;
+        TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
+        } else {
+            TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
+        }
+        return nResult;
+    }
     return 0;
 }