当你鼠标右键单击时的位置point(-1,-1)时
是鼠标的位置移到point(5,5)处
是鼠标的位置移到point(5,5)处
解决方案 »
- 求一思路
- 怎样快速简单将CString类型转换成Unicode支持的字符串,看我这个,我用的是vs2003.net
- 100分(我为什么不能给500?)求一段拼接位图数据流的代码
- VC 打开 文件 如何 筛选 文件名
- 寒,csdn论坛搜索怎么那么多失效链接~
- 如何生成一个随机字符串的问题
- 用vc 做一个人通讯录,选什么数据库?
- 问一本书﹐Sybex出版,美迪亚公司所译<COM和COM+从入门到精通>
- system()函数不懂的地方,请教!!!
- 在VC下怎样更新WINDOWS状态栏
- 如何在基于CWnd类下产生的控件有弹出式菜单(PopupMenu)
- 关于在VC++6.0使用 _outp,_inp函数的问题!
void CMainFrame::OnContextMenu(CWnd*, CPoint point){
if (point.x == -1 && point.y == -1){
CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point = rect.TopLeft();
point.Offset(5, 5);
}
CMenu menu;
VERIFY(menu.LoadMenu(CG_IDR_POPUP_MAIN_FRAME));
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);
}
windows为了稳定,设了很多冗余措施!ok!http://www.csdn.net/cnshare/soft/10/10423.shtm