GpiQueryDefViewingLimits

Description
This function returns the default value of the viewing limits, as set by the GpiSetDefViewingLimits function.

Syntax

 * 1) define INCL_GPIDEFAULTS /* Or use INCL_GPI, INCL_PM, */
 * 2) include 

HPS      hps;         /*  Presentation-space handle. */ PRECTL   prclLimits;  /*  Default viewing limits. */ BOOL     rc;          /*  Success indicator. */

rc = GpiQueryDefViewingLimits(hps, prclLimits);

Parameters

 * hps (HPS) - input : Presentation-space handle.


 * prclLimits (PRECTL) - output : Default viewing limits.

Return Code

 * rc (BOOL) - returns : Success indicator.

TRUE       Successful completion} FALSE       Error occurred.

Errors
Possible returns from WinGetLastError


 * PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
 * PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.

Example Code
This example uses GpiQueryDefViewingLimits to return the default value of the viewing limits, as set by the GpiSetDefViewingLimits and, if the query succeeds, assigns a variable to the x coordinate of the lower left hand corner of the viewing limits rectangle.
 * 1) define INCL_GPIDEFAULTS       /* Default functions            */
 * 2) include 

BOOL fSuccess;         /* success indicator                    */ HPS   hps;             /* Presentation-space handle            */ RECTL prclLimits;      /* default viewing limits               */ LONG  lLwrLftxCoord;   /* lower left x coordinate of limit     */

fSuccess = GpiQueryDefViewingLimits(hps, &prclLimits);

/* if successful, assign lower left x coordinate of viewing limit */ if (fSuccess == TRUE) lLwrLftxCoord = prclLimits.xLeft;