CPoint point;
UINT nFlags;
GetCursorPos(&point);
m_list.ScreenToClient(&point);//CListCtrl m_list;
int index = m_list.HitTest(point,&nFlags);
ClientToScreen(&point);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_OPENPRO_RIGHT));
CMenu* pPopup = menu.GetSubMenu(0);
.............
pPopup->TrackPopupMenu(0, point.x, point.y, this);
pPopup->DestroyMenu();
看看以上代码,注意ScreenToClient与ClientToScreen
UINT nFlags;
GetCursorPos(&point);
m_list.ScreenToClient(&point);//CListCtrl m_list;
int index = m_list.HitTest(point,&nFlags);
ClientToScreen(&point);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_OPENPRO_RIGHT));
CMenu* pPopup = menu.GetSubMenu(0);
.............
pPopup->TrackPopupMenu(0, point.x, point.y, this);
pPopup->DestroyMenu();
看看以上代码,注意ScreenToClient与ClientToScreen
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货