1. void CMoveDlg::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x,point.y)); CDialog::OnLButtonDown(nFlags, point); } 2. LRESULT CMoveDlg::OnNcHitTest(CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 ScreenToClient(&point); CRect rc; GetClientRect(&rc); if(rc.PtInRect(point)) { return HTCAPTION; } return CDialog::OnNcHitTest(point); }