[PATCH 1/2] comctl32/datetime: Do not call default procedure for WM_NCCREATE.

Nikolay Sivov nsivov at codeweavers.com
Fri Sep 25 02:36:16 CDT 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/datetime.c       |  2 +-
 dlls/comctl32/tests/datetime.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index ace00c75505..8c403dde136 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -1277,7 +1277,7 @@ DATETIME_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
     dwExStyle |= WS_EX_CLIENTEDGE;
     SetWindowLongW(hwnd, GWL_EXSTYLE, dwExStyle);
 
-    return DefWindowProcW(hwnd, WM_NCCREATE, 0, (LPARAM)lpcs);
+    return 1;
 }
 
 
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index 111f0bee899..47d7a8fbe56 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -765,6 +765,7 @@ static void test_wm_set_get_text(void)
 {
     static const CHAR a_str[] = "a";
     CHAR buff[16], time[16], caltype[3];
+    WCHAR buffW[16];
     HWND hWnd;
     LRESULT ret;
 
@@ -802,6 +803,16 @@ static void test_wm_set_get_text(void)
     }
 
     DestroyWindow(hWnd);
+
+    /* Window text is not preserved. */
+    hWnd = CreateWindowExA(0, DATETIMEPICK_CLASSA, "testname", 0, 0, 50, 300, 120,
+            NULL, NULL, NULL, NULL);
+
+    buffW[0] = 1;
+    InternalGetWindowText(hWnd, buffW, ARRAY_SIZE(buffW));
+    ok(!buffW[0], "Unexpected window text %s.\n", wine_dbgstr_w(buffW));
+
+    DestroyWindow(hWnd);
 }
 
 static void test_dts_shownone(void)
-- 
2.28.0




More information about the wine-devel mailing list