Jump to content

WinIsRectEmpty: Difference between revisions

From EDM2
Created page with "This function ''checks whether a rectangle is empty''. ==Syntax== WinIsRectEmpty(hab, prclprc) ==Parameters== ;hab (HAB) - Input : Anchor-block handle. ;prclprc (PRECTL) - Input : Rectangle to be checked. :;Note :: The value of each field in this structure must be in the range -32 768 through 32 767. The data type WRECT can also be used, if supported by the language. ==Returns== ;rc (BOOL) - returns : Empty indicator. :;TRUE :: Rectangle is empty :;FA..."
 
 
Line 56: Line 56:
* [[WinInflateRect]]
* [[WinInflateRect]]
* [[WinIntersectRect]]
* [[WinIntersectRect]]
* [[WinIsRectEmpty]]
* [[WinOffsetRect]]
* [[WinOffsetRect]]
* [[WinPtInRect]]
* [[WinPtInRect]]

Latest revision as of 03:10, 9 April 2025

This function checks whether a rectangle is empty.

Syntax

WinIsRectEmpty(hab, prclprc)

Parameters

hab (HAB) - Input
Anchor-block handle.
prclprc (PRECTL) - Input
Rectangle to be checked.
Note
The value of each field in this structure must be in the range -32 768 through 32 767. The data type WRECT can also be used, if supported by the language.

Returns

rc (BOOL) - returns
Empty indicator.
TRUE
Rectangle is empty
FALSE
Rectangle is not empty

Remarks

A rectangle has area if its left edge coordinate is less than its right edge coordinate, and its bottom edge coordinate is less than its top edge coordinate. An empty rectangle is one with no area.

Errors

Possible returns from WinGetLastError: (No specific errors were listed in the provided text.)

Example Code

#define INCL_WINRECTANGLES /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HAB     hab;      /*  Anchor-block handle. */
PRECTL  prclprc;  /*  Rectangle to be checked. */
BOOL    rc;       /*  Empty indicator. */

rc = WinIsRectEmpty(hab, prclprc);

This example checks if a rectangle is empty (i.e. it has no area).

#define INCL_WINRECTANGLES      /* Window Rectangle Functions   */
#include <os2.h>

BOOL  fEmpty;           /* empty indicator                      */
HAB   hab;              /* anchor-block handle                  */
RECTL prclRect1 = {0,0,100,100}; /* rectangle                   */

fEmpty = WinIsRectEmpty(hab, &prclRect1);

Related Functions