<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 21, 2019 at 9:40 PM Fabian Maurer <<a href="mailto:dark.shadow4@web.de">dark.shadow4@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Fabian Maurer <<a href="mailto:dark.shadow4@web.de" target="_blank">dark.shadow4@web.de</a>><br>
---<br>
 dlls/comctl32/tests/combo.c | 37 +++++++++++++++++++++++++++++++++++++<br>
 1 file changed, 37 insertions(+)<br>
<br>
diff --git a/dlls/comctl32/tests/combo.c b/dlls/comctl32/tests/combo.c<br>
index 923d826b30..5a1ba408f0 100644<br>
--- a/dlls/comctl32/tests/combo.c<br>
+++ b/dlls/comctl32/tests/combo.c<br>
@@ -46,6 +46,8 @@ static HWND hComboExParentWnd, hMainWnd;<br>
 static HINSTANCE hMainHinst;<br>
 static const char ComboExTestClass[] = "ComboExTestClass";<br>
<br>
+static HBRUSH brush_red;<br>
+<br>
 static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);<br>
<br>
 #define MAX_CHARS 100<br>
@@ -507,6 +509,8 @@ static BOOL init(void)<br>
     wc.lpfnWndProc = ComboExTestWndProc;<br>
     RegisterClassA(&wc);<br>
<br>
+    brush_red = CreateSolidBrush(RGB(255, 0, 0));<br>
+<br>
     hMainWnd = CreateWindowA(WC_STATICA, "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0);<br>
     ShowWindow(hMainWnd, SW_SHOW);<br>
<br>
@@ -533,6 +537,7 @@ static void cleanup(void)<br>
     UnregisterClassA(ComboExTestClass, GetModuleHandleA(NULL));<br>
<br>
     DestroyWindow(hMainWnd);<br>
+    DeleteObject(brush_red);<br>
 }<br>
<br>
 static void test_comboex_subclass(void)<br>
@@ -748,6 +753,8 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPAR<br>
             break;<br>
         }<br>
         break;<br>
+    case WM_CTLCOLORSTATIC:<br>
+         return (LRESULT) brush_red;<br>
     }<br>
<br>
     return CallWindowProcA(old_parent_proc, hwnd, msg, wparam, lparam);<br>
@@ -1254,6 +1261,35 @@ static void test_combo_dropdown_size(DWORD style)<br>
     }<br>
 }<br>
<br>
+static void test_WM_CTLCOLORSTATIC(void)<br>
+{<br>
+    HBRUSH brush;<br>
+    LOGBRUSH logbrush;<br>
+    int result;<br>
+    COMBOBOXINFO info;<br>
+    COLORREF color_expected = RGB(255, 0, 0);<br>
+    HWND handle_combo = create_combobox(CBS_DROPDOWN);<br>
+<br>
+    old_parent_proc = (void *)SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc);<br>
+<br>
+    info.cbSize = sizeof(COMBOBOXINFO);<br>
+    SetLastError(0xdeadbeef);<br>
+    result = GetComboBoxInfo(handle_combo, &info);<br>
+    ok(result, "Failed to get combobox info structure.\n");<br>
+<br>
+    SendMessageA(info.hwndItem, EM_SETREADONLY, (WPARAM)TRUE, 0);<br>
+    brush = (HBRUSH)SendMessageA(handle_combo, WM_CTLCOLORSTATIC, 0, (LPARAM)info.hwndItem);<br>
+<br>
+    result = GetObjectA(brush, sizeof(logbrush), &logbrush);<br>
+    ok(result > 0, "GetObject failed: %d!\n", GetLastError());<br>
+<br>
+    todo_wine<br>
+    ok(logbrush.lbColor == color_expected, "Expected %x, got %x\n", color_expected, logbrush.lbColor);<br>
+<br>
+    DestroyWindow(handle_combo);<br>
+    SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc);<br>
+}<br><br></blockquote><div><br></div><div>This looks too complicated. I don't think you need to test actual color, it should be enough to return different stock brush from what default procedure returns. Another question is how any of this is affected by read-only switch, and why your fix is not affected by it. </div></div></div>