[Bug 18130] New: VB APPS: Using edit controls context menu crashes application.

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Apr 20 21:53:54 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=18130

           Summary: VB APPS: Using edit controls context menu crashes
                    application.
           Product: Wine
           Version: 1.1.19
          Platform: Other
        OS/Version: other
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: martinmnet at hotmail.com


Vb applications crash when I click on any selection from edit windows context
menu.
Reason:
menu control is sending WM_COMMAND msg to edit control and shouldnt be.
The VB runtime subclass' the edit control and dies when receiving WM_COMMAND
with the sent wParam.
Solution. 
Change menu.c approx line 2561 to check if window is appropriate before sending
WM_COMMAND, i.e. not edit class windows.
Replace edit.c function EDIT_WM_Command

static void EDIT_WM_MenuSelect(EDITSTATE *es, INT code, INT id, HWND control)
{
        static INT SelectedItem;

        if (id != 0) {
                /* Save the currently selected item and return */
                SelectedItem = id;
                return;
        }

        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;
        }
}
and change edit.c line 5195

        case WM_COMMAND:
                EDIT_WM_Command(es, HIWORD(wParam),
LOWORD(wParam),(HWND)lParam);

to
        case WM_MENUSELECT:
                EDIT_WM_MenuSelect(es, HIWORD(wParam),
LOWORD(wParam),(HWND)lParam);


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list