MFC点击控件拖动窗口

void CMouseClickDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
    CDialogEx::OnLButtonDown(nFlags, point);
    CRect rt;
    m_Title.GetWindowRect(&rt);
    ScreenToClient(&rt);
    if ((point.x >= rt.left && point.x <= rt.right)
        && (point.y >= rt.top && point.y <= rt.bottom))
    {
        PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x,   point.y));
    }
}

 

posted @ 2016-10-23 17:44  程序员大叔  阅读(1244)  评论(0编辑  收藏  举报