This example doubles the size of a rectangle if the mouse is double clicked (WM_BUTTON1DBLCLK) within the rectangle (WinPtInRect).

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

BOOL  fSuccess;         /* success indicator                    */
HAB     hab;            /* anchor-block handle                  */
RECTL prclRect1 = {0,0,100,100}; /* rectangle                   */
LONG   lcx = 100;       /* Horizontal expansion                 */
LONG   lcy = 100;       /* Vertical expansion                   */
POINTL ptl;             /* current mouse position               */
MPARAM mpParam1;        /* Parameter 1  (x,y) point value       */

case WM_BUTTON1DBLCLK:
     ptl.x = (LONG) SHORT1FROMMP(mpParam1);
     ptl.y = (LONG) SHORT2FROMMP(mpParam1);

     if (WinPtInRect(hab, &prclRect1, &ptl))
        fSuccess = WinInflateRect(hab, &prclRect1, lcx, lcy);


[Back] [Next]