想通过点中对话框的非标题部分移动对话框,记得比较简单,但是
忘记怎么做了?手边没有msdn,那位帮一下忙?

解决方案 »

  1.   

    void CSampleDialog : : OnLbuttonDown (UINT nFlags, Cpoint point ) 

      Cdialog : : OnLButtonDow (nFlags, goint ); 
      //Fool dialog into thinking simeone clicked on its caption bar . 
    PostMessage (WM_NCLBUTTONDOWN , HTCAPTION , MAKELPARM (point.x , point. y) ) 
    }
      

  2.   

    在OnNcHittest中直接return HTCAPTION.
      

  3.   

    BOOL CYourDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message==WM_LBUTTONDOWN)
    {
    SendMessage(WM_SYSCOMMAND,SC_MOVE,0);
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  4.   

    在OnNcHittest消息响应中直接return HTCAPTION,模拟标题栏