GpiQueryDefViewingLimits
Appearance
This function returns the default value of the viewing limits, as set by the GpiSetDefViewingLimits function.
Syntax
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.
#define INCL_GPIDEFAULTS /* Default functions */ #include <os2.h> 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;