[PATCH 1/2] user32: Use correct values to deselect combo box text with EM_SETSEL
Hugh McMaster
hugh.mcmaster at outlook.com
Mon Jan 25 04:32:09 CST 2016
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
dlls/user32/combo.c | 2 ++
dlls/user32/tests/combo.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index c744ee5..4c57b72 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -1189,6 +1189,8 @@ static void COMBO_KillFocus( LPHEADCOMBO lphc )
{
if( CB_GETTYPE(lphc) == CBS_DROPDOWNLIST )
SendMessageW(lphc->hWndLBox, LB_CARETOFF, 0, 0);
+ else
+ SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, 0);
lphc->wState &= ~CBF_FOCUSED;
diff --git a/dlls/user32/tests/combo.c b/dlls/user32/tests/combo.c
index 77eb678..2b3c4ee 100644
--- a/dlls/user32/tests/combo.c
+++ b/dlls/user32/tests/combo.c
@@ -619,7 +619,7 @@ static void test_editselection_focus(DWORD style)
SendMessageA(hMainWnd, WM_NEXTDLGCTL, (WPARAM)hButton, TRUE);
ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
- todo_wine ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
+ ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
ok(hCBN_KillFocus == hCombo, "Wrong handle set by CBN_KILLFOCUS; got %p\n", hCBN_KillFocus);
ok(GetFocus() == hButton, "hButton should have keyboard focus\n");
@@ -634,7 +634,7 @@ static void test_editselection_focus(DWORD style)
SendMessageA(hMainWnd, WM_NEXTDLGCTL, (WPARAM)hButton, TRUE);
ok(setsel_start == 0, "Unexpected EM_SETSEL start value; got %ld\n", setsel_start);
- todo_wine ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
+ ok(setsel_end == 0, "Unexpected EM_SETSEL end value; got %ld\n", setsel_end);
ok(hCBN_KillFocus == hCombo, "Wrong handle set by CBN_KILLFOCUS; got %p\n", hCBN_KillFocus);
ok(GetFocus() == hButton, "hButton should have keyboard focus\n");
len = SendMessageA(hCombo, CB_GETEDITSEL, 0, 0);
--
1.9.1
More information about the wine-patches
mailing list