user32: Set the edit text in a combobox only if combobox has strings.

This commit is contained in:
Dmitry Timoshkov 2007-12-19 17:36:36 +08:00 committed by Alexandre Julliard
parent 9e3ab87a9c
commit 0e799c6d7b
1 changed files with 6 additions and 3 deletions

View File

@ -1030,9 +1030,12 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
} }
} }
lphc->wState |= (CBF_NOEDITNOTIFY | CBF_NOLBSELECT); if( CB_HASSTRINGS(lphc) )
SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : (LPARAM)empty_stringW); {
lphc->wState &= ~(CBF_NOEDITNOTIFY | CBF_NOLBSELECT); lphc->wState |= (CBF_NOEDITNOTIFY | CBF_NOLBSELECT);
SendMessageW(lphc->hWndEdit, WM_SETTEXT, 0, pText ? (LPARAM)pText : (LPARAM)empty_stringW);
lphc->wState &= ~(CBF_NOEDITNOTIFY | CBF_NOLBSELECT);
}
if( lphc->wState & CBF_FOCUSED ) if( lphc->wState & CBF_FOCUSED )
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1)); SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));