(转载)无标题对话框如何拖动

方法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);  
  }  
方法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;  
  }
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);  
  }
原文地址:https://www.cnblogs.com/ccmfc/p/1844460.html