Commit 538a9037 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

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

parent 1c5e5ded
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment