select the combo box text when getting the focus

Raimonds Praude raimonds.praude at sets.lv
Wed Feb 1 02:59:26 CST 2006


When moving the focus to the edit field of a modifiable combo box (e.g., by TAB
key, or changing the focus to it programmatically), the content was not selected.
To correct the error, selection message sending added into WM_SETFOCUS message
processing of a combo box.

Index: dlls/user/combo.c
===================================================================
RCS file: /home/wine/wine/dlls/user/combo.c,v
retrieving revision 1.19
diff -u -r1.19 combo.c
--- dlls/user/combo.c	24 Jan 2006 12:52:25 -0000	1.19
+++ dlls/user/combo.c	31 Jan 2006 11:48:12 -0000
@@ -1947,8 +1947,10 @@
  	case WM_GETFONT:
  		return  (LRESULT)lphc->hFont;
  	case WM_SETFOCUS:
-		if( lphc->wState & CBF_EDIT )
-		    SetFocus( lphc->hWndEdit );
+		if( lphc->wState & CBF_EDIT ) {
+			SetFocus( lphc->hWndEdit );
+			SendMessageW(lphc->hWndEdit, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
+		}
  		else
  		    COMBO_SetFocus( lphc );
  		return  TRUE;



More information about the wine-patches mailing list