Author: mjmartin
Date: Tue Apr 21 07:24:24 2009
New Revision: 40628
URL:
http://svn.reactos.org/svn/reactos?rev=40628&view=rev
Log:
- menu.c: Only send WM_COMMAND messages to the top parent window.
- edit.c: Use WM_MENUSELECT vice WM_COMMAND to determine which clipboard message to send.
- Fixes vb apps edit context menu and maybe others. Bug #4404
Modified:
trunk/reactos/dll/win32/user32/controls/edit.c
trunk/reactos/dll/win32/user32/windows/menu.c
Modified: trunk/reactos/dll/win32/user32/controls/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] Tue Apr 21 07:24:24 2009
@@ -255,7 +255,7 @@
* WM_XXX message handlers
*/
static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c);
-static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND conrtol);
+static void EDIT_WM_MenuSelect(EDITSTATE *es, INT code, INT id, HWND conrtol);
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y);
static void EDIT_WM_Copy(EDITSTATE *es);
static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name);
@@ -947,8 +947,8 @@
EDIT_WM_Clear(es);
break;
- case WM_COMMAND:
- EDIT_WM_Command(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam);
+ case WM_MENUSELECT:
+ EDIT_WM_MenuSelect(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam);
break;
case WM_CONTEXTMENU:
@@ -4224,12 +4224,17 @@
* WM_COMMAND
*
*/
-static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control)
-{
- if (code || control)
+static void EDIT_WM_MenuSelect(EDITSTATE *es, INT code, INT id, HWND control)
+{
+
+ static INT MenuSelected;
+
+ if (id != 0) {
+ MenuSelected = id;
return;
-
- switch (id) {
+ }
+
+ switch (MenuSelected) {
case EM_UNDO:
SendMessageW(es->hwndSelf, WM_UNDO, 0, 0);
break;
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Tue Apr 21 07:24:24 2009
@@ -2375,7 +2375,7 @@
PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND,
MenuInfo->FocusedItem,
(LPARAM)MenuInfo->Self);
- else
+ else if (GetParent(Mt->OwnerWnd) == GetDesktopWindow())
PostMessageW(Mt->OwnerWnd, WM_COMMAND, ItemInfo.wID, 0);
}
}