windows_programming_notes.nbk: Home | Index | Next Page: Recent Changes | Previous Page: Progress Bar Controls


 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,  // rectangle
      POINT pt           // point
    );

Parameters

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.

Remarks

The rectangle must be normalized before PtInRect is called. That is, lprc.right must be greater than lprc.left and lprc.bottom must be greater than lprc.top. If the rectangle is not normalized, a point is never considered inside of the rectangle.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: Recent Changes | Previous Page: Progress Bar Controls


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time