if (point.x == -1 && point.y == void CMenuView::OnContextMenu(CWnd*,CPoint point){// CG:This block was added by the Pop-up Menu component{if (point.x == -1 && point.y == -1){//keystroke invocationCRect rect;GetClientRect(rect);ClientToScreen(rect);po
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 22:57:21
if (point.x == -1 && point.y == void CMenuView::OnContextMenu(CWnd*,CPoint point){// CG:This block was added by the Pop-up Menu component{if (point.x == -1 && point.y == -1){//keystroke invocationCRect rect;GetClientRect(rect);ClientToScreen(rect);po
if (point.x == -1 && point.y ==
void CMenuView::OnContextMenu(CWnd*,CPoint point)
{
// CG:This block was added by the Pop-up Menu component
{
if (point.x == -1 && point.y == -1){
//keystroke invocation
CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point = rect.TopLeft();
point.Offset(5,5);
}
mfc里右键菜单设置,这个好像是把界面坐标转化为屏幕坐标,但是if (point.x == -1 && point.y == -1)这个干吗呢?
if (point.x == -1 && point.y == void CMenuView::OnContextMenu(CWnd*,CPoint point){// CG:This block was added by the Pop-up Menu component{if (point.x == -1 && point.y == -1){//keystroke invocationCRect rect;GetClientRect(rect);ClientToScreen(rect);po
point.x == -1 && point.y == -1是用来判断你鼠标右键单击时,鼠标的位置是否在客户区,即视类窗口,如果在视类窗口,则point.x和point.y都会是-1