怎样做一个基于mfc dialog的popup menu
展开全部
void CPopupDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
GetCursorPos(&point);
ScreenToClient(&point);
CRect rc;
GetClientRect(&rc);
if(rc.PtInRect(point))
{
CMenu temp,*ptr;
temp.LoadMenu(IDR_MENU1);
ptr = temp.GetSubMenu(0);
ClientToScreen(&point);
ptr->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
}
CDialog::OnRButtonDown(nFlags, point);
}
右键弹出菜单IDR_MENU1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询