Huw Davies : comctl32: Forward the focus to the edit control if it exists.

Alexandre Julliard julliard at winehq.org
Tue Sep 25 15:13:38 CDT 2012


Module: wine
Branch: master
Commit: 3cfc2ab772924cc18690c2c86afadeea0f10de9f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3cfc2ab772924cc18690c2c86afadeea0f10de9f

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Sep 25 12:40:17 2012 +0100

comctl32: Forward the focus to the edit control if it exists.

---

 dlls/comctl32/comboex.c       |    3 ++-
 dlls/comctl32/tests/comboex.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index a72f897..d92da3d 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 172e564..7cddbaf 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);
 }
 




More information about the wine-cvs mailing list