dialog拖拽功能

来源:互联网 发布:建筑大师案例分析 知乎 编辑:程序博客网 时间:2024/05/22 02:11

1、消息映射

       ON_WM_NCHITTEST()

2、函数声明

       afx_msg LRESULT OnNcHitTest(CPoint point);

3、函数实现

LRESULT CMFCSeerDlg::OnNcHitTest(CPoint point)

{
    CRect rect;
    GetClientRect(rect);
    ClientToScreen(rect);

    if (rect.PtInRect(point))
        return HTCAPTION;
    return CDialog::OnNcHitTest(point);
}
0 0
原创粉丝点击