Jump to content

GpiQueryClipRegion: Difference between revisions

From EDM2
Created page with "This function returns the handle of the currently selected clip region. ==Syntax== GpiQueryClipRegion(hps) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ==Return Value== ; hrgn (HRGN) - returns : Clip-region handle (if any). :; NULLHANDLE :: Null handle (no region is selected) :; HRGN_ERROR :: Error :; Otherwise :: Clip region handle. ==Remarks== If there is no currently selected clip region, a null handle is returned. ==Errors== Possible..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
;hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.


==Return Value==
==Return Value==
; hrgn ([[HRGN]]) - returns
;hrgn ([[HRGN]]) - returns: Clip-region handle (if any).
: Clip-region handle (if any).
:: NULLHANDLE - Null handle (no region is selected)
:; NULLHANDLE
:: HRGN_ERROR - Error
:: Null handle (no region is selected)
:: Otherwise - Clip region handle.
:; HRGN_ERROR
:: Error
:; Otherwise
:: Clip region handle.


==Remarks==
==Remarks==
Line 23: Line 18:
==Errors==
==Errors==
Possible returns from WinGetLastError:
Possible returns from WinGetLastError:
; PMERR_INV_HPS (0x207F)
; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified.
: 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.


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIREGIONS /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS  hps;  /* Presentation-space handle. */
HRGN hrgn; /* Clip-region handle (if any). */
hrgn = GpiQueryClipRegion(hps);
</PRE>
This example uses GpiQueryClipRegion to return the handle of the currently selected clip region.
This example uses GpiQueryClipRegion to return the handle of the currently selected clip region.
<pre>
<pre>
#define INCL_GPIREGIONS /* Region functions */
#define INCL_GPIREGIONS /* Region functions */
#include &lt;os2.h&gt;
#include <os2.h>


HPS hps; /* Presentation-space handle */
HPS hps; /* Presentation-space handle */

Latest revision as of 00:39, 17 November 2025

This function returns the handle of the currently selected clip region.

Syntax

GpiQueryClipRegion(hps)

Parameters

hps (HPS) - input
Presentation-space handle.

Return Value

hrgn (HRGN) - returns
Clip-region handle (if any).
NULLHANDLE - Null handle (no region is selected)
HRGN_ERROR - Error
Otherwise - Clip region handle.

Remarks

If there is no currently selected clip region, a null handle is returned.

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 GpiQueryClipRegion to return the handle of the currently selected clip region.

#define INCL_GPIREGIONS /* Region functions */
#include <os2.h>

HPS hps; /* Presentation-space handle */
HRGN hrgn; /* clip region handle */

hrgn = GpiQueryClipRegion(hps);