Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WinPtInRect (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINRECTANGLES
BOOL WinPtInRect(hab, prcl, pptl)
HAB hab; /* handle of the anchor block */
PRECTL prcl; /* address of structure with rectangle coordinates */
PPOINTL pptl; /* address of structure with point coordinates */
The WinPtInRect function determines whether a point lies within a
rectangle.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hab Identifies an anchor block.
prcl Points to a RECTL structure containing the rectangle to be
checked.
pptl Points to a POINTL structure containing the point to be checked.
Return Value
The return value is TRUE if the point lies within the rectangle, or FALSE if
the point is outside the rectangle.
Example
This example processes a WM_BUTTON1UP message, converts the mouse pointer
coordinates into a POINTL structure, and calls WinPtInRect to determine if
the mouse was clicked in the predefined global rectangle.
RECTL rclGlobal; /* global set to some predefined rectangle */
POINTL ptl;
HPS hps;
case WM_BUTTON1UP:
ptl.x = (LONG) SHORT1FROMMP(mp1);
ptl.y = (LONG) SHORT2FROMMP(mp1);
if (WinPtInRect(hab, /* anchor-block handle */
&rclGlobal, /* address of the rectangle */
&ptl)) { /* address of the point */
See Also
GpiPtInRegion, RECTL
♦