void CRectangleDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
lButtonDownNotUp = TRUE;
RECT rect;
m_showRectangle. GetClientRect( &rect ) ;
if( (point. x<rect. right) && (point. x>rect. left) && (point. y<rect. bottom)
&& (point. y>rect. top) )
regionLeftTopTemp = point;
}
CDialog::OnLButtonDown(nFlags, point);
}
void CRectangleDlg::OnMouseMove(UINT nFlags, CPoint point)
{
m_showRectangle. GetClientRect( &rect );
if( ( < ) && ( > ) && ( < ) && ( > ) )
{
if( ( lButtonDownNotUp == TRUE )
{
regionRightBottomTemp = point;
CDC * pDC = m_showRectangle. GetWindowDC ();
pDC -> Rectangle( CRect( regionLeftTopTemp, regionRightBottomTemp ) ) ;
CDialog::OnMouseMove(nFlags, point);
}
void CRectangleDlg::OnLButtonUp(UINT nFlags, CPoint point)
CDialog::OnLButtonUp(nFlags, point);
}
评论0
最新资源