Popup menu clicking the right mouse button
Try overloading the WM_CONTEXTMENU message in your view, and then use the
code suggested by Pamela.
The code will look something like this:
CMyView::OnContextMenu(CWnd *pWnd, CPoint point)
{
CPoint local = point;
GetParentFrame()->ActivateFrame();
ScreenToClient(&local);
// Load menu from Resource
CMenu menu;
LoadProperMenu(local, menu);
// Get popup menu from first submenu
CMenu *pPopup = menu.GetSubMenu(0);
ASSERT_VALID(pPopup);
// Display Popup menu
pPopup->TrackPopupMenu(TPM_LEFTALIGN |TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
point.x, point.y, AfxGetMainWnd());
Quote:
}
Michael
Quote:
> Hi all.
> Is there a way to make a poupmenu appear clicking the right mouse
> button. I've create the menu in .rc file and I want to show it.
> Thanks in advance
> Stefano