[MFC Copy Code] 마우스 이벤트, 드래그시 화면 객체를 상태 좌표로 이동시키기
MFC&ActiveX/MFC Copy Code 2008. 5. 20. 23:44 |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);
}