GSI

void CGDITestView::OnLButtonDown(UINT nFlags, CPoint point)
{
 SetCapture();

 m_oldPoint = point;

 CView::OnLButtonDown(nFlags, point);
}

void CGDITestView::OnLButtonUp(UINT nFlags, CPoint point)
{
 ReleaseCapture();

 CView::OnLButtonUp(nFlags, point);
}

void CGDITestView::OnMouseMove(UINT nFlags, CPoint point)
{
 if( GetCapture() == this )
 {
  m_realPos += (point - m_oldPoint);
  m_oldPoint = point;

  Invalidate();
 }

 CView::OnMouseMove(nFlags, point);
}

Posted by gsi
: