16,472
社区成员
发帖
与我相关
我的任务
分享
void CNewPrintView::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
{
// TODO: 在此处添加消息处理程序代码
/*;
*/
CString s ;
s.Format(_T("POINT x:%d y:%d 字体所在矩形 left:%d right:%d ,top:%d bottom:%d"),point.x,point.y,ctt.m_nRect.left,ctt.m_nRect.right,ctt.m_nRect.top,ctt.m_nRect.bottom);
AfxMessageBox(s);
if(ctt.IsInRect(point))
{
CMenu menu;
menu.LoadMenu(IDR_SETUP);
CMenu * pMenu;
pMenu = menu.GetSubMenu(0);
pMenu->TrackPopupMenu(TPM_RIGHTBUTTON|TPM_LEFTALIGN,point.x,point.y,this,NULL);
menu.DestroyMenu();
}
}
CRect rec;
GetWindowRect(&rec);
CPoint newPoint;
newPoint.x = point.x - rec.left;
newPoint.y = point.y - rec.top;