Jump to content

GpiQuerySegmentPriority: Difference between revisions

From EDM2
Created page with "This function returns the identifier of the named segment that is chained immediately before or after a specified reference segment. ==Syntax== GpiQuerySegmentPriority(hps, lRefSegid, lOrder) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; lRefSegid (LONG) - input : Reference-segment identifier. ; lOrder (LONG) - input : Segment higher or lower. : Shows whether a segment identifier of a higher or lower priority than identified in the lR..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; lRefSegid ([[LONG]]) - input: Reference-segment identifier.
 
; lOrder (LONG) - input: Segment higher or lower.
; lRefSegid ([[LONG]]) - input
: Reference-segment identifier.
 
; lOrder ([[LONG]]) - input
: Segment higher or lower.
: Shows whether a segment identifier of a higher or lower priority than identified in the lRefSegid parameter is to be returned. Possible values are:
: Shows whether a segment identifier of a higher or lower priority than identified in the lRefSegid parameter is to be returned. Possible values are:
:; LOWER_PRI
::LOWER_PRI: Return the next segment with a lower priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the lowest priority.
:: Return the next segment with a lower priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the lowest priority.
::HIGHER_PRI: Return the next segment with a higher priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the highest priority.
:; HIGHER_PRI
:: Return the next segment with a higher priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the highest priority.


==Return Value==
==Return Value==
; lSegid ([[LONG]]) - returns
; lSegid ([[LONG]]) - returns: Segment identifier.
: Segment identifier.
: The identifier of the segment that is immediately before or after that specified in the lRefSegid parameter:
: The identifier of the segment that is immediately before or after that specified in the lRefSegid parameter:
:; >0
:: >0 : Segment identifier.
:: Segment identifier.
:: 0 : The segment specified in the lRefSegid parameter is either the lowest-priority segment (when lOrder = LOWER_PRI) or the highest-priority segment (when lOrder = HIGHER_PRI).
:; 0
:: GPI_ALTERROR : Error.
:: The segment specified in the lRefSegid parameter is either the lowest-priority segment (when lOrder = LOWER_PRI) or the highest-priority segment (when lOrder = HIGHER_PRI).
:; GPI_ALTERROR
:: Error.


==Remarks==
==Remarks==
Line 52: Line 41:


==Example Code==
==Example Code==
<PRE>
#define INCL_GPISEGMENTS /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS  hps;      /* Presentation-space handle. */
LONG lRefSegid; /* Reference-segment identifier. */
LONG lOrder;    /* Segment higher or lower. */
LONG lSegid;    /* Segment identifier. */
lSegid = GpiQuerySegmentPriority(hps, lRefSegid, lOrder);
</PRE>
This function returns the identifier of the named segment that is chained immediately before or after a specified reference segment.
This function returns the identifier of the named segment that is chained immediately before or after a specified reference segment.
<pre>
<pre>
#define INCL_GPISEGMENTS
#define INCL_GPISEGMENTS
#include &lt;OS2.H&gt;
#include <OS2.H>


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

Latest revision as of 01:52, 24 November 2025

This function returns the identifier of the named segment that is chained immediately before or after a specified reference segment.

Syntax

GpiQuerySegmentPriority(hps, lRefSegid, lOrder)

Parameters

hps (HPS) - input
Presentation-space handle.
lRefSegid (LONG) - input
Reference-segment identifier.
lOrder (LONG) - input
Segment higher or lower.
Shows whether a segment identifier of a higher or lower priority than identified in the lRefSegid parameter is to be returned. Possible values are:
LOWER_PRI: Return the next segment with a lower priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the lowest priority.
HIGHER_PRI: Return the next segment with a higher priority than lRefSegid. If lRefSegid =0, query the identifier of the segment with the highest priority.

Return Value

lSegid (LONG) - returns
Segment identifier.
The identifier of the segment that is immediately before or after that specified in the lRefSegid parameter:
>0 : Segment identifier.
0 : The segment specified in the lRefSegid parameter is either the lowest-priority segment (when lOrder = LOWER_PRI) or the highest-priority segment (when lOrder = HIGHER_PRI).
GPI_ALTERROR : Error.

Remarks

The segment that is chained before the specified segment, is considered to have a lower priority than the specified segment; similarly, the segment that is chained after the specified segment, is considered to have a higher priority than the specified segment. Unnamed segments (with an identifier of zero) are ignored.

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.
PMERR_INV_SEG_NAME (0x20C8)
An invalid segment identifier was specified.
PMERR_INV_ORDERING_PARM (0x20AB)
An invalid order parameter was specified with GpiSetSegmentPriority.
PMERR_SEG_NOT_CHAINED (0x20FF)
An attempt was made to issue GpiDrawFrom, GpiCorrelateFrom or GpiQuerySegmentPriority for a segment that was not chained.
PMERR_SEG_NOT_FOUND (0x2100)
The specified segment identifier did not exist.
PMERR_INV_MICROPS_FUNCTION (0x20A1)
An attempt was made to issue a function that is invalid in a micro presentation space.

Example Code

This function returns the identifier of the named segment that is chained immediately before or after a specified reference segment.

#define INCL_GPISEGMENTS
#include <OS2.H>

HPS hps; /* Presentation-space */
/* handle. */
LONG lSegid; /* Segment identifier */
LONG lRefSegid; /* Reference-segment */
/* identifier. */
LONG lOrder; /* Shows whether a */
/* segment identifier of a */
/* higher or lower priority */
/* than identified in the */
/* lRefSegid parameter is */
/* to be returned. */

lOrder = HIGHER_PRI; /* Return the next */
/* segment with a higher */
/* priority than */
/* lRefSegid. If */
/* lRefSegid=0, query */
/* the identifier of the */
/* segment with the */
/* highest priority. */

lRefSegid = 0; /* find the segment with the highest */
/* priority. */

lSegid = GpiQuerySegmentPriority(hps,
    lRefSegid,
    lOrder);

Related Functions