Zhiyi Zhang : uxtheme/tests: Test WM_ERASEBKGND return value from custom dialog procedures.

Alexandre Julliard julliard at winehq.org
Mon Mar 28 15:53:39 CDT 2022


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Thu Mar 24 17:05:59 2022 +0800

uxtheme/tests: Test WM_ERASEBKGND return value from custom dialog procedures.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/uxtheme/tests/system.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 93b6f1aa8f7..1308d54264b 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1614,6 +1614,7 @@ static const struct message empty_seq[] =
 
 static HWND dialog_child;
 static DWORD dialog_init_flag;
+static BOOL handle_WM_ERASEBKGND;
 static BOOL handle_WM_CTLCOLORSTATIC;
 
 static INT_PTR CALLBACK test_EnableThemeDialogTexture_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
@@ -1639,6 +1640,15 @@ static INT_PTR CALLBACK test_EnableThemeDialogTexture_proc(HWND hwnd, UINT msg,
             EnableThemeDialogTexture(hwnd, dialog_init_flag);
         return TRUE;
 
+    case WM_ERASEBKGND:
+    {
+        if (!handle_WM_ERASEBKGND)
+            return FALSE;
+
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, 0);
+        return TRUE;
+    }
+
     case WM_CTLCOLORSTATIC:
         return (INT_PTR)(handle_WM_CTLCOLORSTATIC ? GetSysColorBrush(COLOR_MENU) : 0);
 
@@ -1876,6 +1886,13 @@ static void test_EnableThemeDialogTexture(void)
        GetSysColorBrush(COLOR_MENU), brush);
     handle_WM_CTLCOLORSTATIC = FALSE;
 
+    /* Test that the dialog procedure should take precedence over DefDlgProc() for WM_ERASEBKGND */
+    handle_WM_ERASEBKGND = TRUE;
+    lr = SendMessageW(dialog, WM_ERASEBKGND, (WPARAM)child_hdc, 0);
+    todo_wine
+    ok(lr == 0, "Expected 0, got %#lx.\n", lr);
+    handle_WM_ERASEBKGND = FALSE;
+
     /* Test that dialog doesn't have theme handle opened for itself */
     ok(GetWindowTheme(dialog) == NULL, "Expected NULL theme handle.\n");
 




More information about the wine-cvs mailing list