C++--如何锁定splitter窗口

class CLockSplitterWnd : public CSplitterWnd;
 
//. . .
 
BEGIN_MESSAGE_MAP(CLockSplitterWnd, CSplitterWnd)
    ON_WM_LBUTTONDOWN()
    ON_WM_SETCURSOR()
    ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()
 
//. . .
 
void CLockSplitterWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
    if(m_bLocked)
        CWnd::OnLButtonDown(nFlags, point);
    else
        CSplitterWnd::OnLButtonDown(nFlags, point);
}
 
BOOL CLockSplitterWnd::OnSetCursor(CWnd* pWnd,
    UINT nHitTest, UINT message)
{
    if(m_bLocked)
        return CWnd::OnSetCursor(pWnd, nHitTest, message);
    else
        return CSplitterWnd::OnSetCursor(pWnd, nHitTest, message);
}
 
void CLockSplitterWnd::OnMouseMove(UINT nFlags, CPoint point)
{
    if(m_bLocked)
        CWnd::OnMouseMove(nFlags, point);
    else
        CSplitterWnd::OnMouseMove(nFlags, point);
}

posted on 2007-08-27 22:40  毛小娃  阅读(131)  评论(0编辑  收藏  举报

导航