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.
GpiDeleteSegments (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPISEGMENTS
 
BOOL GpiDeleteSegments(hps, idFirstSegment, idLastSegment)
HPS hps;                /* presentation-space handle   */
LONG idFirstSegment;    /* identifier of first segment */
LONG idLastSegment;     /* identifier of last segment  */
 
The GpiDeleteSegments function deletes the segments between and including
the segments specified by the idFirstSegment and idLastSegment parameters.
If idFirstSegment and idLastSegment are equal, the function deletes only
that segment. If idFirstSegment is greater than idLastSegment, the function
deletes only the segment specified by idFirstSegment. If any of the segments
is open, the function closes the segment before deleting it. If any of the
segments is in the picture chain, the function removes the segment from the
chain.
 
This function deletes only segments created using the GpiOpenSegment
function.
 
Parameter       Description
────────────────────────────────────────────────────────────────────────────
 
hps             Identifies the presentation space.
 
idFirstSegment  Specifies the identifier of the first segment to delete.
                This parameter must be greater than zero.
 
idLastSegment   Specifies the identifier of the last segment to delete. This
                parameter must be greater than zero.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR 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_MICROPS_FUNCTION
     PMERR_INV_SEG_NAME
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiDeleteSegments function to delete segments 4
through 6:
 
GpiDeleteSegments(hps, 4L, 6L);       /* delete segments 4 through 6 */
 
See Also
 
GpiCloseSegment, GpiDeleteSegment, GpiOpenSegment, GpiQuerySegmentNames,
WinGetLastError