diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index a72f897a4bf..d92da3d8a46 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -2308,7 +2308,8 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return COMBOEX_WindowPosChanging (infoPtr, (WINDOWPOS *)lParam); case WM_SETFOCUS: - SetFocus(infoPtr->hwndCombo); + if (infoPtr->hwndEdit) SetFocus( infoPtr->hwndEdit ); + else SetFocus( infoPtr->hwndCombo ); return 0; case WM_SYSCOLORCHANGE: diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index 172e56429d4..7cddbafdf08 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -345,6 +345,11 @@ static void test_WM_LBUTTONDOWN(void) "Current Selection: expected %d, got %d\n", 4, idx); ok(received_end_edit, "Expected to receive a CBEN_ENDEDIT message\n"); + SetFocus( hComboExParentWnd ); + ok( GetFocus() == hComboExParentWnd, "got %p\n", GetFocus() ); + SetFocus( hComboEx ); + ok( GetFocus() == hEdit, "got %p\n", GetFocus() ); + DestroyWindow(hComboEx); }