Subj : Re: Context menu To : borland.public.cpp.borlandcpp From : Gary Setter Date : Wed Aug 18 2004 09:52 am "MarvinAvery" wrote in message news:412240b8@newsgroups.borland.com... > Hi. > > In my app, I have a window that contains a number of child windows, one of > which is an edit control. This window processes the WM_CONTEXTMENU message > to popup my own context menu whenever the user clicks the right mouse button > over any of the controls in this window. > > However, since this is a 32-bit app (BC5.02 under WIN2K) the edit control > has its own context menu that pops up if the right mouse button click occurs > over it. Is there an *easy* way of preventing this so that only my context > menu pops up? That is, a way other than writing my own code to intercept and > process the WM_CONTEXTMENU message within the edit control. > > TIA > > -- > Marvin Avery > marvin.avery@sdc-dsc.gc.ca > It works for me. I made an Owl app, dialog based that has an edit control. I have a handler for WM_CONTEXTMENU which creates a popup menu. The normal cut/copy/paste context menu does not appear. This is my handler code // // Build a response table for all messages/commands handled by the application. // DEFINE_RESPONSE_TABLE1(ContextEdit, TEdit) //{{ContextEditRSP_TBL_BEGIN}} EV_WM_CONTEXTMENU, //{{ContextEditRSP_TBL_END}} END_RESPONSE_TABLE; void ContextEdit::EvContextMenu(HWND childHwnd, int x, int y) { // TEdit::EvContextMenu(childHwnd, x, y); HWND hWnd = *this; TPopupMenu pop; pop.AppendMenu(MF_BYPOSITION ,0,"Hi there"); pop.TrackPopupMenu(TPM_CENTERALIGN,x,y,0,hWnd); // INSERT>> Your code here. } Are you receiving any messages at the edit control? Are you subclassing the edit control? Best regards, Gary .