如题

解决方案 »

  1.   

    你用csdn的全文搜索。保证正确答案多得你数不过来
      

  2.   

    响应鼠标单击事件,代码极其简单:SendMessage(WM_NCLBUTTONDOWN,(WPARAM)HTCAPTION,MAKELPARAM(5,5));就行了
      

  3.   

    我这是个笨方法,不知道你能不能用得上
    //{{AFX_MSG(..)
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    //}}AFX_MSG
    ...
    BEGIN_MESSAGE_MAP(...)
    ON_WM_LBUTTONDOWN()
    ON_WM_LBUTTONUP()
    ON_WM_MOUSEMOVE()
    END_MESSAGE_MAP()void CMyDlg::OnLButtonDown(UINT nFlags, CPoint point) 
    {
    m_bMoving = TRUE;
    SetCapture();
    m_pointOld = point;

    CDialog::OnLButtonDown(nFlags, point);
    }void CMyDlg::OnLButtonUp(UINT nFlags, CPoint point) 
    {
    if( m_bMoving == TRUE )
             {
    m_bMoving = FALSE;
    ::ReleaseCapture();
    }

    CDialog::OnLButtonUp(nFlags, point);
    }void CMyDlg::OnMouseMove(UINT nFlags, CPoint point) 
    {
    if( m_bMoving == TRUE ) {
    CRect rect;
    GetWindowRect(&rect);
    rect.left += (point.x - m_pointOld.x);
    rect.right += (point.x - m_pointOld.x);
    rect.top += (point.y - m_pointOld.y);
    rect.bottom += (point.y - m_pointOld.y);
    SetWindowPos(&wndTopMost, rect.left, rect.top,
    rect.right - rect.left, rect.bottom - rect.top,
    SWP_SHOWWINDOW);
    } CDialog::OnMouseMove(nFlags, point);
    }