This example uses the WinUnionRect call to find a rectangle that bounds two source rectangles.
#define INCL_WINRECTANGLES #include <OS2.H> HAB hab; RECTL resultrcl; /* result. */ RECTL rcla={25, /* x coordinate of left-hand edge of */ /* rectangle. */ 25, /* y coordinate of bottom edge of */ /* rectangle. */ 125, /* x coordinate of right-hand edge of */ /* rectangle. */ 125}; /* y coordinate of top edge of rectangle. */ RECTL rclb = {15, /* x coordinate of left-hand edge of */ /* rectangle. */ 15, /* y coordinate of bottom edge of */ /* rectangle. */ 125, /* x coordinate of right-hand edge of */ /* rectangle. */ 125}; WinUnionRect(hab, &resultrcl, &rcla, &rclb);