This example determines the intersection of two rectangles and places the result in a third rectangle structure.
#define INCL_WINRECTANGLES /* Window Rectangle Functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HAB hab; /* anchor-block handle */ PRECTL prclRect1 = {0,0,100,100}; /* rectangle 1 */ PRECTL prclRect2 = {0,0,200,200}; /* rectangle 2 */ PRECTL prclDest; /* destination rectangle */ fSuccess = WinIntersectRect(hab, &prclDest, &prclRect1, &prclRect2);