<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
The following patch fixes 18130. In my tests, context menu for the Edit window control does not send the WM_COMMAND message.<br>Please comment.<br><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><!--StartFragment--> dlls/user32/edit.c |   70 ++++++++++++++++++++-------------------------------</p>
<p style="margin: 0px; text-indent: 0px;"> 1 files changed, 28 insertions(+), 42 deletions(-)</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c</p>
<p style="margin: 0px; text-indent: 0px;">index eadcc3d..601ffa5 100644</p>
<p style="margin: 0px; text-indent: 0px;">--- a/dlls/user32/edit.c</p>
<p style="margin: 0px; text-indent: 0px;">+++ b/dlls/user32/edit.c</p>
<p style="margin: 0px; text-indent: 0px;">@@ -3357,43 +3357,6 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;"> /*********************************************************************</p>
<p style="margin: 0px; text-indent: 0px;">  *</p>
<p style="margin: 0px; text-indent: 0px;">- *        WM_COMMAND</p>
<p style="margin: 0px; text-indent: 0px;">- *</p>
<p style="margin: 0px; text-indent: 0px;">- */</p>
<p style="margin: 0px; text-indent: 0px;">-static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control)</p>
<p style="margin: 0px; text-indent: 0px;">-{</p>
<p style="margin: 0px; text-indent: 0px;">-        if (code || control)</p>
<p style="margin: 0px; text-indent: 0px;">-                return;</p>
<p style="margin: 0px; text-indent: 0px;">-</p>
<p style="margin: 0px; text-indent: 0px;">-        switch (id) {</p>
<p style="margin: 0px; text-indent: 0px;">-                case EM_UNDO:</p>
<p style="margin: 0px; text-indent: 0px;">-                        SendMessageW(es-&gt;hwndSelf, WM_UNDO, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                case WM_CUT:</p>
<p style="margin: 0px; text-indent: 0px;">-                        SendMessageW(es-&gt;hwndSelf, WM_CUT, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                case WM_COPY:</p>
<p style="margin: 0px; text-indent: 0px;">-                        SendMessageW(es-&gt;hwndSelf, WM_COPY, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                case WM_PASTE:</p>
<p style="margin: 0px; text-indent: 0px;">-                        SendMessageW(es-&gt;hwndSelf, WM_PASTE, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                case WM_CLEAR:</p>
<p style="margin: 0px; text-indent: 0px;">-                        SendMessageW(es-&gt;hwndSelf, WM_CLEAR, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                case EM_SETSEL:</p>
<p style="margin: 0px; text-indent: 0px;">-                        EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE);</p>
<p style="margin: 0px; text-indent: 0px;">-                        EDIT_EM_ScrollCaret(es);</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-                default:</p>
<p style="margin: 0px; text-indent: 0px;">-                        ERR("unknown menu item, please report\n");</p>
<p style="margin: 0px; text-indent: 0px;">-                        break;</p>
<p style="margin: 0px; text-indent: 0px;">-        }</p>
<p style="margin: 0px; text-indent: 0px;">-}</p>
<p style="margin: 0px; text-indent: 0px;">-</p>
<p style="margin: 0px; text-indent: 0px;">-</p>
<p style="margin: 0px; text-indent: 0px;">-/*********************************************************************</p>
<p style="margin: 0px; text-indent: 0px;">- *</p>
<p style="margin: 0px; text-indent: 0px;">  *        WM_CONTEXTMENU</p>
<p style="margin: 0px; text-indent: 0px;">  *</p>
<p style="margin: 0px; text-indent: 0px;">  *        Note: the resource files resource/sysres_??.rc cannot define a</p>
<p style="margin: 0px; text-indent: 0px;">@@ -3414,6 +3377,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)</p>
<p style="margin: 0px; text-indent: 0px;">         HMENU popup = GetSubMenu(menu, 0);</p>
<p style="margin: 0px; text-indent: 0px;">         UINT start = es-&gt;selection_start;</p>
<p style="margin: 0px; text-indent: 0px;">         UINT end = es-&gt;selection_end;</p>
<p style="margin: 0px; text-indent: 0px;">+        BOOL selectedMenuItem;</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;">         ORDER_UINT(start, end);</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;">@@ -3440,7 +3404,33 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)</p>
<p style="margin: 0px; text-indent: 0px;">             y = rc.top + (rc.bottom - rc.top) / 2;</p>
<p style="margin: 0px; text-indent: 0px;">         }</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;">-        TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, es-&gt;hwndSelf, NULL);</p>
<p style="margin: 0px; text-indent: 0px;">+        selectedMenuItem = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TMPRETURNCMD, x, y, 0, es-&gt;hwndSelf, NULL);</p>
<p style="margin: 0px; text-indent: 0px;">+        switch (selectedMenuItem) {</p>
<p style="margin: 0px; text-indent: 0px;">+                case 0:</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case EM_UNDO:</p>
<p style="margin: 0px; text-indent: 0px;">+                        SendMessageW(es-&gt;hwndSelf, WM_UNDO, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case WM_CUT:</p>
<p style="margin: 0px; text-indent: 0px;">+                        SendMessageW(es-&gt;hwndSelf, WM_CUT, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case WM_COPY:</p>
<p style="margin: 0px; text-indent: 0px;">+                        SendMessageW(es-&gt;hwndSelf, WM_COPY, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case WM_PASTE:</p>
<p style="margin: 0px; text-indent: 0px;">+                        SendMessageW(es-&gt;hwndSelf, WM_PASTE, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case WM_CLEAR:</p>
<p style="margin: 0px; text-indent: 0px;">+                        SendMessageW(es-&gt;hwndSelf, WM_CLEAR, 0, 0);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                case EM_SETSEL:</p>
<p style="margin: 0px; text-indent: 0px;">+                        EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE);</p>
<p style="margin: 0px; text-indent: 0px;">+                        EDIT_EM_ScrollCaret(es);</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+                default:</p>
<p style="margin: 0px; text-indent: 0px;">+                        ERR("unknown menu item, please report\n");</p>
<p style="margin: 0px; text-indent: 0px;">+                        break;</p>
<p style="margin: 0px; text-indent: 0px;">+        }</p>
<p style="margin: 0px; text-indent: 0px;">         DestroyMenu(menu);</p>
<p style="margin: 0px; text-indent: 0px;"> }</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;">@@ -5192,10 +5182,6 @@ static LRESULT EditWndProc_common( HWND hwnd, UINT msg,</p>
<p style="margin: 0px; text-indent: 0px;">                 EDIT_WM_Clear(es);</p>
<p style="margin: 0px; text-indent: 0px;">                 break;</p>
<p style="margin: 0px; text-indent: 0px;"> </p>
<p style="margin: 0px; text-indent: 0px;">-        case WM_COMMAND:</p>
<p style="margin: 0px; text-indent: 0px;">-                EDIT_WM_Command(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam);</p>
<p style="margin: 0px; text-indent: 0px;">-                break;</p>
<p style="margin: 0px; text-indent: 0px;">-</p>
<p style="margin: 0px; text-indent: 0px;">         case WM_CONTEXTMENU:</p>
<p style="margin: 0px; text-indent: 0px;">                 EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam));</p>
<p style="margin: 0px; text-indent: 0px;">                 break;</p>
<p style="margin: 0px; text-indent: 0px;"><!--EndFragment--></p><br><a href="http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009"></a><br /><hr />Windows Live™ SkyDrive™: Get 25 GB of free online storage.   <a href='http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009' target='_new'>Get it on your BlackBerry or iPhone.</a></body>
</html>