MDI中如何判断鼠标点击在子窗体之外?

解决方案 »

  1.   

    这样好象可以BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
    { if(WM_LBUTTONDOWN == pMsg->message) { CFmView *pFmView ;
    pFmView = (CFmView*)GetActiveFrame()->GetActiveView(); if (pFmView == NULL) {
    return FALSE;
    } CRect   rect;   
    pFmView->GetClientRect(rect);
    ClientToScreen(rect);

    CPoint point;
    ::GetCursorPos(&point);
    ScreenToClient(&point);

    BOOL curIn = FALSE;
    if(rect.PtInRect(point)   ) {   
    curIn = TRUE;     
    }   

    //其他处理
    }

    return CMDIFrameWnd::PreTranslateMessage(pMsg);
    }