窗口拖动

 

定义函数:

afx_msg LRESULT OnNcHitTest(CPoint pt);

消息映射:

BEGIN_MESSAGE_MAP(CMy57projectDlg, CDialog)
    ON_WM_NCHITTEST()
END_MESSAGE_MAP()

函数实现:

LRESULT CMy57projectDlg::OnNcHitTest(CPoint pt)
{
CRect rc;
GetClientRect(&rc);
ClientToScreen(&rc);
return rc.PtInRect(pt) ? HTCAPTION : CDialog::OnNcHitTest(pt);
}

 

posted @ 2018-08-07 14:47  余生以学  阅读(111)  评论(0编辑  收藏  举报