WORD EnumObj(
LPPDEVICE lpDestDev,
WORD wStyle,
FARPROC lpCallbackFunc,
LPVOID lpClientData
);
Enumerates the pens and brushes available on the device.
OBJ_PEN (1) | Pen |
OBJ_BRUSH (2) | Brush |
OBJ_FONT (3) | Font |
EnumObj enumerates all objects of the given type. If there are no objects of the given type, the function must return 1.
The export ordinal for this function is 7.
GDI calls the EnumObj function when an application calls the EnumObjects function. For each object having the given style, EnumObj calls the callback function with the logical information for that object. EnumObj continues to call the callback function until there are no more objects or the callback function returns zero.
Every graphics driver must export an EnumObj function.
Before calling the callback function, EnumObj must fill the LOGPEN or LOGBRUSH structure with the logical colors and other values that correspond to a given physical pen or brush.
To support some older applications (such as Microsoft Excel versions earlier than 2.1), EnumObj specifies the 8 default EGA colors in the first 8 objects it enumerates:
EGA color | RGB value |
---|---|
Black | 0,0,0 |
White | 0xFF,0xFF,0xFF |
Red | 0xFF,0,0 |
Green | 0,0xFF,0 |
Blue | 0,0,0xFF |
Yellow | 0xFF,0xFF,0 |
Magenta | 0xFF,0,0xFF |
Cyan | 0,0xFF,0xFF |
If the driver supports additional colors, EnumObj can specify those colors in any order. Because some applications end after enumerating the first 16 colors, the second 8 colors to be enumerated should be the most desirable colors for the device.
EnumObj should enumerate solid pens before styled lines. Enumerating styled pens is optional. The function should enumerate: solid pens, styled pens (optional), solid brushes (no dithered colors), and hatched brushes.
EnumObj does not need to specify the background colors for hatched brushes.
PDEVICE, PBITMAP, LOGBRUSH, LOGPEN, EnumObjCallback