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.
GpiQuerySetIds (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPILCIDS
BOOL GpiQuerySetIds(hps, cSets, alTypes, pstr8, alcid)
HPS hps; /* presentation-space handle */
LONG cSets; /* number of objects to query */
PLONG alTypes; /* address of array of types */
PSTR8 pstr8; /* address of array for names */
PLONG alcid; /* address of array for local identifiers */
The GpiQuerySetIds function retrieves a list of types, names, and local
identifiers for all current logical fonts and tagged bitmaps. The function
copies the information to the arrays pointed to by the alTypes, pstr8, and
alcid parameters. The type specifies whether the object is a logical font or
tagged bitmap. The name is an 8-character string that uniquely identifies
the object. Not all objects have names.
The GpiQuerySetIds function retrieves information for only the number of
objects specified by the cSets parameter, starting with the object having
local identifier 1. If information for all objects is needed, the
GpiQueryNumberSetIds function returns a count of all local identifiers in
use.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
cSets Specifies the number of objects to retrieve. It must not be
greater than the number of local identifiers currently in use.
alTypes Points to the array to receive the type for each object. The
function sets each element in this array to either LCIDT_FONT or
LCIDT_BITMAP. The array must have the number of elements
specified by cSets.
pstr8 Points to the array to receive the name for each object. Each
element, itself an array, receives an object name of up to eight
characters. If an object has no name, the element is set to zero.
The array must have the number of elements specified by cSet.
alcid Points to the array that receives the local identifiers. The
array must have the number of elements specified by cSets.
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_LENGTH_OR_COUNT
PMERR_PS_BUSY
Example
This example uses the GpiQuerySetIds function to retrieve the local
identifier for all logical fonts. It then uses the identifiers to delete the
logical fonts.
LONG cIds;
SEL sel;
PLONG plType;
PSTR8 pstr8;
PLONG plcid;
cIds = GpiQueryNumberSetIds(hps); /* get number of local identifiers */
/* Allocate space for type, name, and local-identifier arrays. */
DosAllocSeg((USHORT) cIds * sizeof(LONG), &sel, SEG_NONSHARED);
plType = MAKEP(sel, 0);
DosAllocSeg((USHORT) cIds * sizeof(STR8), &sel, SEG_NONSHARED);
pstr8 = MAKEP(sel, 0);
DosAllocSeg((USHORT) cIds * sizeof(LONG), &sel, SEG_NONSHARED);
plcid = MAKEP(sel, 0);
/* Get the types, names, and local identifiers. */
GpiQuerySetIds(hps, cIds, plType, pstr8, plcid);
/* Delete each local identifier that has LCIDT_FONT type. */
for (i = 1; i < cIds; i++)
if (plTypes[i] == LCIDT_FONT)
GpiDeleteSetId(hps, plcid[i]);
See Also
GpiCreateLogFont, GpiQueryNumberSetIds, GpiSetBitmapId, WinGetLastError
♦