CRect::PtInRect 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 Overview | Class Members | Hierarchy ChartSee Also CRect::NormalizeRect,::PtInRect
或者API PtInRect PtInRect The PtInRect function determines whether the specified point lies within the specified rectangle. A point is within a rectangle if it lies on the left or top side or is within all four sides. A point on the right or bottom side is considered outside the rectangle. BOOL PtInRect( CONST RECT *lprc, // pointer to structure with rectangle POINT pt // structure with point );
Parameters lprc Pointer to a RECT structure that contains the specified rectangle. pt Specifies a POINT structure that contains the specified point. Return Values If the specified point lies within the rectangle, the return value is nonzero.If the specified point does not lie within the rectangle, the return value is zero. Windows NT: To get extended error information, callGetLastError. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winuser.h. Import Library: Use user32.lib.See Also Rectangles Overview, Rectangle Functions, EqualRect, IsRectEmpty, POINT, RECT
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 Overview | Class Members | Hierarchy ChartSee Also CRect::NormalizeRect,::PtInRect
PtInRect
The PtInRect function determines whether the specified point lies within the specified rectangle. A point is within a rectangle if it lies on the left or top side or is within all four sides. A point on the right or bottom side is considered outside the rectangle. BOOL PtInRect(
CONST RECT *lprc, // pointer to structure with rectangle
POINT pt // structure with point
);
Parameters
lprc
Pointer to a RECT structure that contains the specified rectangle.
pt
Specifies a POINT structure that contains the specified point.
Return Values
If the specified point lies within the rectangle, the return value is nonzero.If the specified point does not lie within the rectangle, the return value is zero. Windows NT: To get extended error information, callGetLastError. QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.See Also
Rectangles Overview, Rectangle Functions, EqualRect, IsRectEmpty, POINT, RECT