PtInRect

  BOOL PtInRect(lprc, pt)    
  CONST RECT *lprc; /* address of structure with rectangle */
  POINT pt; /* structure with point */

The PtInRect function determines whether the specified point lies within a given 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.

Parameters

lprc

Points to a RECT structure that contains the specified rectangle. The RECT structure has the following form:

typedef struct tagRECT { /* rc */

LONG left;

LONG top;

LONG right;

LONG bottom;

} RECT;

pt

Specifies a POINT structure that contains the specified point. The POINT structure has the following form:

typedef struct tagPOINT { /* pt */

LONG x;

LONG y;

} POINT;

Return Value

The return value is TRUE if specified point lies within the given rectangle. Otherwise, it is FALSE.