方法1:
void CYourDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION);
CDialog::OnLButtonDown(nFlags, point);
}
void CYourDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION);
CDialog::OnLButtonDown(nFlags, point);
}
方法2:
UINT CYourDlg::OnNcHitTest(CPoint point)
{
// TODO: Add your message handler code here and/or call default
UINT ret=CDialog::OnNcHitTest(point);
if(ret==HTCLIENT)ret=HTCAPTION;
return ret;
}
UINT CYourDlg::OnNcHitTest(CPoint point)
{
// TODO: Add your message handler code here and/or call default
UINT ret=CDialog::OnNcHitTest(point);
if(ret==HTCLIENT)ret=HTCAPTION;
return ret;
}
LRESULT CAboutDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_LBUTTONDOWN)
{
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,lParam);
return 0;
}
else return CDialog::WindowProc(message, wParam, lParam);
}
{
if(message == WM_LBUTTONDOWN)
{
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,lParam);
return 0;
}
else return CDialog::WindowProc(message, wParam, lParam);
}