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/07/29 20:02:15
![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](/uploads/image/z/9287761-49-1.jpg?t=if+%28point.x+%3D%3D+-1+%26%26+point.y+%3D%3D+void+CMenuView%3A%3AOnContextMenu%28CWnd%2A%2CCPoint+point%29%7B%2F%2F+CG%3AThis+block+was+added+by+the+Pop-up+Menu+component%7Bif+%28point.x+%3D%3D+-1+%26%26+point.y+%3D%3D+-1%29%7B%2F%2Fkeystroke+invocationCRect+rect%3BGetClientRect%28rect%29%3BClientToScreen%28rect%29%3Bpo)
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