From: Hugh McMaster Subject: [PATCH 1/2] user32: Use correct values to deselect combo box text with EM_SETSEL Message-Id: Date: Mon, 25 Jan 2016 21:32:09 +1100 Signed-off-by: Hugh McMaster --- 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