Piotr Caban : user32: Add more CB_SETCURSEL tests on ComboBox.
Alexandre Julliard
julliard at winehq.org
Fri Jan 5 14:02:04 CST 2018
Module: wine
Branch: master
Commit: a5118adbbca903d686b8f12316ab642c682f3db9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a5118adbbca903d686b8f12316ab642c682f3db9
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Jan 5 19:25:46 2018 +0100
user32: Add more CB_SETCURSEL tests on ComboBox.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/combo.c | 2 +-
dlls/user32/tests/msg.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index 0c530f7..b69f892 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -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 ))
{
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 64c7967..f391ab9 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -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);
More information about the wine-cvs
mailing list