Module: wine Branch: master Commit: d987c277c12bc17a77c9d79b92024d449f9a85f9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=d987c277c12bc17a77c9d79b9...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Mar 24 17:06:07 2022 +0800
uxtheme: Return correct WM_ERASEBKGND result from custom dialog procedures.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/uxtheme/dialog.c | 3 ++- dlls/uxtheme/tests/system.c | 3 +-- 2 files changed, 3 insertions(+), 3 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..1f04ac879ec 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -1889,8 +1889,7 @@ 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); + ok(lr == 0, "Expected 0, got %#Ix.\n", lr); handle_WM_ERASEBKGND = FALSE;
/* Test that dialog doesn't have theme handle opened for itself */