BOOL IsRectEmpty(lprc) | |||||
const RECT FAR* lprc; | /* address of structure with rectangle | */ |
The IsRectEmpty function determines whether the specified rectangle is empty. A rectangle is empty if its width or height is zero, or if both are zero.
lprc
Points to a RECT structure that contains the coordinates of the rectangle. The RECT structure has the following form:
typedef struct tagRECT { /* rc */
int left;
int top;
int right;
int bottom;
} RECT;
For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.
The return value is nonzero if the rectangle is empty. Otherwise, it is zero.
The following example uses the IsRectEmpty function to determine whether a rectangle is empty and then displays a message box giving the status of the rectangle:
RECT
rc; if (IsRectEmpty((LPRECT) &rc)) MessageBox(hwnd, "Rectangle is empty.", "Rectangle Status", MB_OK); else MessageBox(hwnd, "Rectangle is not empty.", "Rectangle Status", MB_OK);