- Patch by MudHead : Combobox sends a message to the deselect the text when focus is lost.
CORE-10266 #resolve

svn path=/trunk/; revision=75436
This commit is contained in:
James Tabor 2017-07-29 01:59:07 +00:00
parent 63568c9f24
commit 91dda33431
3 changed files with 37 additions and 0 deletions

View file

@ -46,6 +46,7 @@ extern "C" {
#define WM_NCUAHDRAWFRAME 0x000000AF
#define WM_SYSTIMER 0x00000118
#define WM_LBTRACKPOINT 0x00000131
#define WM_CBLOSTTEXTFOCUS 0x00000167
#define LB_CARETON 0x000001a3
#define LB_CARETOFF 0x000001a4
#define MN_SETHMENU 0x000001e0

View file

@ -2260,6 +2260,19 @@ LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPAR
NtUserInvalidateRect(lphc->self, &lphc->textRect, TRUE);
}
break;
case WM_CBLOSTTEXTFOCUS: /* undocumented message - deselects the text when focus is lost */
{
if (lphc->hWndEdit != NULL)
{
SendMessage(lphc->self, WM_LBUTTONUP, 0, 0xFFFFFFFF);
SendMessage(lphc->hWndEdit, EM_SETSEL, 0, 0);
lphc->wState &= ~CBF_FOCUSED;
CB_NOTIFY(lphc, CBN_KILLFOCUS);
}
}
return TRUE;
#endif
default:

View file

@ -3628,6 +3628,28 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
*/
static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
{
#ifdef __REACTOS__
HWND hCombo;
LONG lStyles;
es->flags &= ~EF_FOCUSED;
DestroyCaret();
if(!(es->style & ES_NOHIDESEL))
EDIT_InvalidateText(es, es->selection_start, es->selection_end);
/* throw away left over scroll when we lose focus */
es->wheelDeltaRemainder = 0;
if (es->hwndListBox == NULL)
EDIT_NOTIFY_PARENT(es, EN_KILLFOCUS);
else
{ /* send the undocumented WM_CBLOSTTEXTFOCUS message to combobox */
hCombo = GetParent(es->hwndSelf);
lStyles = GetWindowLong(hCombo, GWL_STYLE);
if ((lStyles & CBS_DROPDOWN) || (lStyles & CBS_SIMPLE))
SendMessage(hCombo, WM_CBLOSTTEXTFOCUS, 0, 0);
}
#else
es->flags &= ~EF_FOCUSED;
DestroyCaret();
if(!(es->style & ES_NOHIDESEL))
@ -3635,6 +3657,7 @@ static LRESULT EDIT_WM_KillFocus(EDITSTATE *es)
EDIT_NOTIFY_PARENT(es, EN_KILLFOCUS);
/* throw away left over scroll when we lose focus */
es->wheelDeltaRemainder = 0;
#endif
return 0;
}