Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- 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");