Context menu in C单机斗地主免费下载RichEditCtrl - CutPaste

博彩动态 2019-04-15 06:48168http://www.cn-shibo.comadmin

I'm using a derived class from CRichEditCtrl, and I'd like to perform
the two following things :

1) create a context menu when the user right clicks in the control. I
thought that overriding WM_CONTEXTMENU would work, but unfortunately it
doesn't. Here's the resulting code :

--------------------------
void CMyCtrl::OnContextMenu(CWnd* pWnd, CPoint point)
{
        CMenu menu;
        menu.LoadMenu(IDR_MAINFRAME);
        menu.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
point.x, point.y, this);

Quote:

}

----------------------------

This function is *never* called ... I also tried overriding
WM_RBUTTONDOWN  but is produces strange results, ie the menu doesn't
appear where I click (it appears at the top of the window). Any
suggestion ?

2) perform cut&paste operations. Do I have to program cut&paste myself,
by calling member functions Cut() and Paste() of CRichEditCtrl, or is it
another way to perform such operations ?

Please note, I don't want to use CRichEditView, because I'm using a
derivative of CView which contains 3 CRichEditCtrl, and I'd like
different context menus to appear in those 3 controls.

Thanks for any suggestion and help :)

Raphael

博彩游戏:Context menu in C单机斗地主免费下载RichEditCtrl - CutPaste

Copyright © 2002-2019 博彩游戏 版权所有 备案号:鄂ICP备12012219号-2