[PATCH 3/4] uxtheme: Return correct WM_ERASEBKGND result from custom dialog procedures.

Zhiyi Zhang zzhang at codeweavers.com
Thu Mar 24 04:06:07 CDT 2022


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/uxtheme/dialog.c       | 3 ++-
 dlls/uxtheme/tests/system.c | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/uxtheme/dialog.c b/dlls/uxtheme/dialog.c
index 706d170936e..13943d753bb 100644
--- a/dlls/uxtheme/dialog.c
+++ b/dlls/uxtheme/dialog.c
@@ -129,9 +129,10 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, BOO
     case WM_ERASEBKGND:
     {
         dlgproc = (WNDPROC)GetWindowLongPtrW(hwnd, DWLP_DLGPROC);
+        SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, 0);
         lr = LOWORD(CallWindowProcW(dlgproc, hwnd, msg, wp, lp));
         if (lr)
-            return lr;
+            return GetWindowLongPtrW(hwnd, DWLP_MSGRESULT);
 
         brush = get_dialog_background_brush(hwnd, TRUE);
         if (!brush)
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 1308d54264b..2dc1975961c 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1889,7 +1889,6 @@ static void test_EnableThemeDialogTexture(void)
     /* 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;
 
-- 
2.32.0




More information about the wine-devel mailing list