15,979
社区成员
发帖
与我相关
我的任务
分享
void CMyF1Dlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
// CG: This block was added by the Pop-up Menu component//Pop-Up Menu在代码上就添加了下面的这段
{
if (point.x == -1 && point.y == -1){
//keystroke invocation
CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point = rect.TopLeft();
point.Offset(5, 5);
}
CMenu menu;
VERIFY(menu.LoadMenu(CG_IDR_POPUP_ABOUT_DLG));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
pWndPopupOwner);
}
}
void CMyF1Dlg::OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/ )
void CMyF1Dlg::OnContextMenu(CWnd* pWnd, CPoint point)
CMenu menu;
menu.LoadMenu(IDR_MENU1);
CMenu* pPopup = menu.GetSubMenu(0);
ClientToScreen(&point);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,GetParent());