user32: Add more CB_SETCURSEL tests on ComboBox.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2018-01-05 19:25:46 +01:00 committed by Alexandre Julliard
parent a912b23771
commit a5118adbbc
2 changed files with 17 additions and 1 deletions

View File

@ -726,7 +726,7 @@ static void CBPaintText(
static const WCHAR empty_stringW[] = { 0 };
if( CB_HASSTRINGS(lphc) ) SetWindowTextW( lphc->hWndEdit, pText ? pText : empty_stringW );
if( lphc->wState & CBF_FOCUSED )
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, MAXLONG);
}
else if(!(lphc->wState & CBF_NOREDRAW) && IsWindowVisible( lphc->self ))
{

View File

@ -6625,6 +6625,14 @@ static const struct message SetCurSelComboSeq2[] =
{ 0 }
};
static const struct message SetCurSelComboSeq_edit[] =
{
{ CB_SETCURSEL, sent|wparam|lparam, 0, 0 },
{ WM_SETTEXT, sent|wparam, 0 },
{ EM_SETSEL, sent|wparam|lparam, 0, INT_MAX },
{ 0 }
};
static const struct message WmKeyDownComboSeq[] =
{
{ WM_KEYDOWN, sent|wparam|lparam, VK_DOWN, 0 },
@ -6926,6 +6934,14 @@ static void test_combobox_messages(void)
log_all_parent_messages--;
ok_sequence(SetFocusButtonSeq2, "SetFocus on a Button (2)", TRUE);
SetFocus(combo);
SendMessageA(combo, WM_SETREDRAW, FALSE, 0);
flush_sequence();
log_all_parent_messages++;
SendMessageA(combo, CB_SETCURSEL, 0, 0);
log_all_parent_messages--;
ok_sequence(SetCurSelComboSeq_edit, "CB_SETCURSEL on a ComboBox with edit control", FALSE);
DestroyWindow(button);
DestroyWindow(combo);