gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiQuerySegmentNames (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPISEGMENTS
 
LONG GpiQuerySegmentNames(hps, idFirstSegment, idLastSegment, cidMax,
    paidSegments)
HPS hps;                /* presentation-space handle     */
LONG idFirstSegment;    /* first segment                 */
LONG idLastSegment;     /* last segment                  */
LONG cidMax;            /* maximum number of segments    */
PLONG paidSegments;     /* address of array for segments */
 
The GpiQuerySegmentNames function retrieves the identifiers of all existing
segments whose identifiers are in the range specified by the idFirstSegment
and idLastSegment parameters.
 
If the idFirstSegment parameter is equal to or greater than the
idLastSegment parameter, the function only checks for the segment having the
identifier specified by idFirstSegment.
 
Parameter       Description
────────────────────────────────────────────────────────────────────────────
 
hps             Identifies the presentation space.
 
idFirstSegment  Specifies the first segment in the range; it must be greater
                than zero.
 
idLastSegment   Specifies the last segment; it must be greater than zero.
 
cidMax          Specifies the maximum number of segment identifiers to
                retrieve.
 
paidSegments    Points to the array to receive the segment identifiers. It
                must have the number of elements specified by the cidMax
                parameter.
 
Return Value
 
The return value is the number of segment identifiers returned if the
function is successful or GPI_ALTERROR if an error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_HPS
     PMERR_INV_LENGTH_OR_COUNT
     PMERR_INV_MICROPS_FUNCTION
     PMERR_INV_SEG_NAME
     PMERR_PS_BUSY
 
See Also
 
GpiOpenSegment, WinGetLastError