Nikolay Sivov : comctl32/datetime: Do not call default procedure for WM_NCCREATE.

Alexandre Julliard julliard at winehq.org
Fri Sep 25 14:52:53 CDT 2020


Module: wine
Branch: master
Commit: 9a5c9be164beddf21d7ff4ca18128085d1050c4f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9a5c9be164beddf21d7ff4ca18128085d1050c4f

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Sep 25 10:36:16 2020 +0300

comctl32/datetime: Do not call default procedure for WM_NCCREATE.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 ace00c7550..8c403dde13 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 111f0bee89..47d7a8fbe5 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)




More information about the wine-cvs mailing list