The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. 

解决方案 »

  1.   

    CWnd* pParent = GetParent();   //Retrieve the old postion (in parent client coordinates)
        CRect oldPos;
    GetClientRect(&oldPos);
    ClientToScreen(oldPos);
    pParent->ScreenToClient(&oldPos);    //Work out the new position (in parent client coordinates)
        CRect newPos(point.x - m_nDragOffset.x, point.y - m_nDragOffset.y, 
                     point.x - m_nDragOffset.x + m_nIconWidth, point.y  - m_nDragOffset.y + m_nIconHeight);
        ClientToScreen(&newPos);
        pParent->ScreenToClient(&newPos);
      

  2.   

    masterz() 不是说过了吗,GETWINDOWRECT(...)
      

  3.   

    GetWindowRect()得到相对于屏幕的坐标,GetClientRect()得到相对于本程序窗口的坐标.
    在这里,你应该用前者