[PATCH 3/3] comctl32/pager: Support WM_NOTIFYFORMAT message.

Zhiyi Zhang zzhang at codeweavers.com
Fri Aug 24 09:04:49 CDT 2018


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/comctl32/pager.c       | 25 +++++++++++++++++++++++++
 dlls/comctl32/tests/pager.c |  8 ++++----
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c
index fe68515e67..de63cad717 100644
--- a/dlls/comctl32/pager.c
+++ b/dlls/comctl32/pager.c
@@ -71,6 +71,7 @@ typedef struct
     HWND   hwndSelf;   /* handle of the control wnd */
     HWND   hwndChild;  /* handle of the contained wnd */
     HWND   hwndNotify; /* handle of the parent wnd */
+    BOOL   bUnicode;   /* send notifications in Unicode */
     DWORD  dwStyle;    /* styles for this control */
     COLORREF clrBk;    /* background color */
     INT    nBorder;    /* border size for the control */
@@ -555,6 +556,7 @@ static LRESULT
 PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
 {
     PAGER_INFO *infoPtr;
+    INT ret;
 
     /* allocate memory for info structure */
     infoPtr = heap_alloc_zero (sizeof(*infoPtr));
@@ -581,6 +583,9 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
     if (infoPtr->dwStyle & PGS_DRAGNDROP)
         FIXME("[%p] Drag and Drop style is not implemented yet.\n", infoPtr->hwndSelf);
 
+    ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
+    infoPtr->bUnicode = (ret == NFR_UNICODE);
+
     return 0;
 }
 
@@ -998,6 +1003,23 @@ PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lp
     return 0;
 }
 
+static LRESULT PAGER_NotifyFormat(PAGER_INFO *infoPtr, INT command)
+{
+    INT ret;
+    switch (command)
+    {
+    case NF_REQUERY:
+        ret = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
+        infoPtr->bUnicode = (ret == NFR_UNICODE);
+        return ret;
+    case NF_QUERY:
+        /* Pager always wants Unicode notifications from children */
+        return NFR_UNICODE;
+    default:
+        return 0;
+    }
+}
+
 static LRESULT WINAPI
 PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
@@ -1089,6 +1111,9 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
         case WM_TIMER:
             return PAGER_Timer (infoPtr, (INT)wParam);
 
+        case WM_NOTIFYFORMAT:
+            return PAGER_NotifyFormat (infoPtr, lParam);
+
         case WM_NOTIFY:
         case WM_COMMAND:
             return SendMessageW (infoPtr->hwndNotify, uMsg, wParam, lParam);
diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index f2ac8b299a..a1f6683a57 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -392,8 +392,8 @@ static void test_wm_notifyformat(void)
         /* Test parent */
         notify_query_received = FALSE;
         ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY);
-        todo_wine_if(notify_format == NFR_ANSI) ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
-        todo_wine ok(notify_query_received, "Didn't receive notify\n");
+        ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
+        ok(notify_query_received, "Didn't receive notify\n");
 
         /* Send NF_QUERY directly to parent */
         notify_query_received = FALSE;
@@ -404,8 +404,8 @@ static void test_wm_notifyformat(void)
         /* Pager send notifications to its parent regardless of wParam */
         notify_query_received = FALSE;
         ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY);
-        todo_wine_if(notify_format == NFR_ANSI) ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
-        todo_wine ok(notify_query_received, "Didn't receive notify\n");
+        ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
+        ok(notify_query_received, "Didn't receive notify\n");
 
         /* Pager always wants Unicode notifications from children */
         ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY);
-- 
2.18.0




More information about the wine-devel mailing list