void CDlg::OnMouseMove(UINT nFlags, CPoint point)
{
if(m_bDragging)
{
CDC* pDC = GetDC();
CRect rect = CRect(m_pointStart, point);
CRect rect2 = CRect(m_pointStart, m_pointEnd);
rect.NormalizeRect();
rect2.NormalizeRect();
pDC->DrawDragRect(rect, CSize(1, 1), rect2, CSize(1, 1));
m_pointEnd = point;
}
CDialog::OnMouseMove(nFlags, point);
}
void CDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
m_pointStart.x = point.x;
m_pointStart.y = point.y;
m_bDragging = TRUE;
CDialog::OnLButtonDown(nFlags, point);
}
'MFC' 카테고리의 다른 글
GDI object 생성, 소멸 (0) | 2012.10.05 |
---|---|
EnumWindowsProc (0) | 2012.10.05 |
Drag file on dialog (0) | 2012.10.05 |
Dialog에서 부모 윈도우 알아내기 (0) | 2012.10.05 |
CRectTracker를 이용한 러버밴드 만들기 (0) | 2012.10.05 |