16,472
社区成员
发帖
与我相关
我的任务
分享
void CMainWindow::OnContextMenu(CWnd* pWnd,CPoint point)
{
CRect rect;
GetClientRect(&rect);
ClientToScreen(&rect);
if(rect.PtInRect(point))
{
CMenu* pMenu = GetSystemMenu(FALSE);
UpdateSystemMenu(pMenu);
int nID = (int)pMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|
TPM_RIGHTBUTTON|TPM_RETURNCMD,point.x,point.y,this);
if(nID > 0)
SendMessage(WM_SYSCOMMAND,nID,0);
return;
}
CFrameWnd::OnContextMenu(pWnd,point);
}
if(nID > 0)
SendMessage(WM_SYSCOMMAND,nID,0);