void CMyBView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (!isrect)
{
startpoint=point;
temppoint=point;
flags=TRUE;
}
CView::OnLButtonDown(nFlags, point);
}
void CMyBView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (flags)
{
CDC *pDC=GetDC();
CRect rect(startpoint.x, startpoint.y, temppoint.x, temppoint.y);
rect.NormalizeRect();
pDC->DrawFocusRect(rect);
rect.SetRect(startpoint.x, startpoint.y, point.x, point.y);
rect.NormalizeRect();
pDC->DrawFocusRect(rect);
temppoint=point;
isrect=TRUE;
ReleaseDC(pDC);
}
CView::OnMouseMove(nFlags, point);
}
void CMyBView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
flags=FALSE;
CView::OnLButtonUp(nFlags, point);
}
void CMyBView::OnRButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(isrect)
{
CDC *pDC=GetDC();
CRect rect(startpoint.x, startpoint.y, temppoint.x, temppoint.y);
rect.NormalizeRect();
pDC->DrawFocusRect(rect);
ReleaseDC(pDC);
isrect=FALSE;
}
CView::OnRButtonUp(nFlags, point);
}