BOOL PtInRect( POINT point ) const;Return ValueNonzero if the point lies within CRect; otherwise 0.ParameterspointContains a POINT structure or CPoint object.ResDetermines whether the specified point lies within CRect. A point is within CRect if it lies on the left or top side or is within all four sides. A point on the right or bottom side is outside CRect.Note The rectangle must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangle before calling this function.
事件:
CRect rect;
if(rect.PtInRect(CPoint))
{
......
}
void CMydilog::OnMouseMove(UINT nFlags, CPoint point)
{
if( point.x>10&& point.x<100//在此范围内提示
point.y>10&& point.y<100)
{
CString str="mystring";
CDC* pDC=new CDC;
pDC=GetDC();
pDC->TextOut(x,y,str,str.GetLength());
}
CDialog::OnMouseMove(nFlags, point);
}