mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 23:25:09 +00:00
[user32]
- Reapply changes from 40677 as the edit control does not receive the WM_COMMAND message from its context menu when doing clipboard ops. - Fixes crashes in applications created with visual basic when using edit controls context menu. - If we lose this in next sync, ill grovel and beg. svn path=/trunk/; revision=43925
This commit is contained in:
parent
ae81274578
commit
78ce662964
|
@ -3381,43 +3381,6 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* WM_COMMAND
|
||||
*
|
||||
*/
|
||||
static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control)
|
||||
{
|
||||
if (code || control)
|
||||
return;
|
||||
|
||||
switch (id) {
|
||||
case EM_UNDO:
|
||||
SendMessageW(es->hwndSelf, WM_UNDO, 0, 0);
|
||||
break;
|
||||
case WM_CUT:
|
||||
SendMessageW(es->hwndSelf, WM_CUT, 0, 0);
|
||||
break;
|
||||
case WM_COPY:
|
||||
SendMessageW(es->hwndSelf, WM_COPY, 0, 0);
|
||||
break;
|
||||
case WM_PASTE:
|
||||
SendMessageW(es->hwndSelf, WM_PASTE, 0, 0);
|
||||
break;
|
||||
case WM_CLEAR:
|
||||
SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0);
|
||||
break;
|
||||
case EM_SETSEL:
|
||||
EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE);
|
||||
EDIT_EM_ScrollCaret(es);
|
||||
break;
|
||||
default:
|
||||
ERR("unknown menu item, please report\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* WM_CONTEXTMENU
|
||||
|
@ -3445,6 +3408,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
|
|||
UINT start = es->selection_start;
|
||||
UINT end = es->selection_end;
|
||||
|
||||
BOOL selectedItem;
|
||||
ORDER_UINT(start, end);
|
||||
|
||||
/* undo */
|
||||
|
@ -3470,7 +3434,33 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
|
|||
y = rc.top + (rc.bottom - rc.top) / 2;
|
||||
}
|
||||
|
||||
TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, es->hwndSelf, NULL);
|
||||
selectedItem = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, x, y, 0, es->hwndSelf, NULL);
|
||||
|
||||
switch (selectedItem) {
|
||||
case EM_UNDO:
|
||||
SendMessageW(es->hwndSelf, WM_UNDO, 0, 0);
|
||||
break;
|
||||
case WM_CUT:
|
||||
SendMessageW(es->hwndSelf, WM_CUT, 0, 0);
|
||||
break;
|
||||
case WM_COPY:
|
||||
SendMessageW(es->hwndSelf, WM_COPY, 0, 0);
|
||||
break;
|
||||
case WM_PASTE:
|
||||
SendMessageW(es->hwndSelf, WM_PASTE, 0, 0);
|
||||
break;
|
||||
case WM_CLEAR:
|
||||
SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0);
|
||||
break;
|
||||
case EM_SETSEL:
|
||||
EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE);
|
||||
EDIT_EM_ScrollCaret(es);
|
||||
break;
|
||||
default:
|
||||
ERR("unknown menu item, please report\n");
|
||||
break;
|
||||
}
|
||||
|
||||
DestroyMenu(menu);
|
||||
}
|
||||
|
||||
|
@ -5300,11 +5290,7 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
|
|||
EDIT_WM_Clear(es);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
EDIT_WM_Command(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam);
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
case WM_CONTEXTMENU:
|
||||
EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue