Author: jimtabor Date: Fri Feb 6 21:07:59 2015 New Revision: 66183
URL: http://svn.reactos.org/svn/reactos?rev=66183&view=rev Log: [WineTests|User32] - Sync Combo to wine head. Patch by Huw Davies : Make the combo's listbox a topmost window. See CORE-5186 for prior report.
Modified: trunk/rostests/winetests/user32/combo.c
Modified: trunk/rostests/winetests/user32/combo.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/combo.c?r... ============================================================================== --- trunk/rostests/winetests/user32/combo.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/combo.c [iso-8859-1] Fri Feb 6 21:07:59 2015 @@ -537,6 +537,61 @@ DestroyWindow(hCombo); }
+static void test_listbox_styles(DWORD cb_style) +{ + BOOL (WINAPI *pGetComboBoxInfo)(HWND, PCOMBOBOXINFO); + HWND combo; + COMBOBOXINFO info; + DWORD style, exstyle, expect_style, expect_exstyle; + BOOL ret; + + pGetComboBoxInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"), "GetComboBoxInfo"); + if (!pGetComboBoxInfo){ + win_skip("GetComboBoxInfo is not available\n"); + return; + } + + expect_style = WS_CHILD|WS_CLIPSIBLINGS|LBS_COMBOBOX|LBS_HASSTRINGS|LBS_NOTIFY; + if (cb_style == CBS_SIMPLE) + { + expect_style |= WS_VISIBLE; + expect_exstyle = WS_EX_CLIENTEDGE; + } + else + { + expect_style |= WS_BORDER; + expect_exstyle = WS_EX_TOOLWINDOW; + } + + combo = build_combo(cb_style); + info.cbSize = sizeof(COMBOBOXINFO); + SetLastError(0xdeadbeef); + ret = pGetComboBoxInfo(combo, &info); + ok(ret, "Failed to get combobox info structure.\n"); + + style = GetWindowLongW( info.hwndList, GWL_STYLE ); + exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); + ok(style == expect_style, "%08x: got %08x\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + + if (cb_style != CBS_SIMPLE) + expect_exstyle |= WS_EX_TOPMOST; + + SendMessageW(combo, CB_SHOWDROPDOWN, TRUE, 0 ); + style = GetWindowLongW( info.hwndList, GWL_STYLE ); + exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); + ok(style == (expect_style | WS_VISIBLE), "%08x: got %08x\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + + SendMessageW(combo, CB_SHOWDROPDOWN, FALSE, 0 ); + style = GetWindowLongW( info.hwndList, GWL_STYLE ); + exstyle = GetWindowLongW( info.hwndList, GWL_EXSTYLE ); + ok(style == expect_style, "%08x: got %08x\n", cb_style, style); + ok(exstyle == expect_exstyle, "%08x: got %08x\n", cb_style, exstyle); + + DestroyWindow(combo); +} + START_TEST(combo) { hMainWnd = CreateWindowA("static", "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0); @@ -551,6 +606,9 @@ test_changesize(CBS_DROPDOWN); test_changesize(CBS_DROPDOWNLIST); test_editselection(); + test_listbox_styles(CBS_SIMPLE); + test_listbox_styles(CBS_DROPDOWN); + test_listbox_styles(CBS_DROPDOWNLIST);
DestroyWindow(hMainWnd); }