Jump to content

GpiQueryDefViewingLimits: Difference between revisions

From EDM2
Created page with "==Description== This function returns the default value of the viewing limits, as set by the GpiSetDefViewingLimits function. ==Syntax== <pre> #define INCL_GPIDEFAULTS /* Or..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
==Description==
This function returns the default value of the viewing limits, as set by the [[GpiSetDefViewingLimits]] function.
This function returns the default value of the viewing limits, as set by the GpiSetDefViewingLimits function.  


==Syntax==
==Syntax==
<pre>
  GpiQueryDefViewingLimits(hps, prclLimits)
#define INCL_GPIDEFAULTS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS      hps;        /*  Presentation-space handle. */
PRECTL    prclLimits;  /*  Default viewing limits. */
BOOL      rc;          /* Success indicator. */
 
rc = GpiQueryDefViewingLimits(hps, prclLimits);
</pre>


==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.  
;hps (HPS) - input: Presentation-space handle.
 
;prclLimits (PRECTL) - output: Default viewing limits.
; prclLimits (PRECTL) - output : Default viewing limits.


==Return Code==
==Return Code==
; rc (BOOL) - returns : Success indicator.
;rc (BOOL) - returns: Success indicator.
 
::TRUE - Successful completion}
TRUE       Successful completion}
::FALSE - Error occurred.
FALSE       Error occurred.


===Errors===
===Errors===
Possible returns from WinGetLastError
Possible returns from WinGetLastError:
 
;PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
; 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.
; PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.
 
==Remarks==


==Example Code==
==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.  
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.
<pre>
<pre>
#define INCL_GPIDEFAULTS        /* Default functions            */
#define INCL_GPIDEFAULTS        /* Default functions            */
Line 51: Line 36:
</pre>
</pre>


==Related Functions==
[[Category:Gpi]]
 
[[Category:GPI]]

Latest revision as of 12:24, 26 June 2021

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;