Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/user32/tests/combo.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
diff --git a/dlls/user32/tests/combo.c b/dlls/user32/tests/combo.c index 0d3b1b170f..b7859ee817 100644 --- a/dlls/user32/tests/combo.c +++ b/dlls/user32/tests/combo.c @@ -33,6 +33,8 @@
static HWND hMainWnd;
+static HBRUSH brush_red; + #define expect_eq(expr, value, type, fmt); { type val = expr; ok(val == (value), #expr " expected " #fmt " got " #fmt "\n", (value), val); } #define expect_rect(r, _left, _top, _right, _bottom) ok(r.left == _left && r.top == _top && \ r.bottom == _bottom && r.right == _right, "Invalid rect %s vs (%d,%d)-(%d,%d)\n", \ @@ -204,6 +206,8 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPAR break; } break; + case WM_CTLCOLORSTATIC: + return (LRESULT) brush_red; }
return CallWindowProcA(old_parent_proc, hwnd, msg, wparam, lparam); @@ -804,8 +808,38 @@ static void test_WS_VSCROLL(void) DestroyWindow(hCombo); }
+static void test_WM_CTLCOLORSTATIC(void) +{ + HBRUSH brush; + LOGBRUSH logbrush; + int result; + COMBOBOXINFO info; + COLORREF color_expected = RGB(255, 0, 0); + HWND handle_combo = build_combo(CBS_DROPDOWN); + + old_parent_proc = (void *)SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc); + + info.cbSize = sizeof(COMBOBOXINFO); + SetLastError(0xdeadbeef); + result = GetComboBoxInfo(handle_combo, &info); + ok(result, "Failed to get combobox info structure.\n"); + + SendMessageA(info.hwndItem, EM_SETREADONLY, (WPARAM)TRUE, 0); + brush = (HBRUSH)SendMessageA(handle_combo, WM_CTLCOLORSTATIC, 0, (LPARAM)info.hwndItem); + + result = GetObjectA(brush, sizeof(logbrush), &logbrush); + ok(result > 0, "GetObject failed: %d!\n", GetLastError()); + + todo_wine + ok(logbrush.lbColor == color_expected, "Expected %x, got %x\n", color_expected, logbrush.lbColor); + + DestroyWindow(handle_combo); + SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc); +} + START_TEST(combo) { + brush_red = CreateSolidBrush(RGB(255, 0, 0)); hMainWnd = CreateWindowA("static", "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0); ShowWindow(hMainWnd, SW_SHOW);
@@ -825,6 +859,8 @@ START_TEST(combo) test_listbox_styles(CBS_DROPDOWN); test_listbox_styles(CBS_DROPDOWNLIST); test_listbox_size(CBS_DROPDOWN); + test_WM_CTLCOLORSTATIC();
DestroyWindow(hMainWnd); + DeleteObject(brush_red); } -- 2.23.0