EnumObjects function (wingdi.h)

The EnumObjects function enumerates the pens or brushes available for the specified device context (DC). This function calls the application-defined callback function once for each available object, supplying data describing that object. EnumObjects continues calling the callback function until the callback function returns zero or until all of the objects have been enumerated.

Syntax

int EnumObjects(
  [in] HDC          hdc,
  [in] int          nType,
  [in] GOBJENUMPROC lpFunc,
  [in] LPARAM       lParam
);

Parameters

[in] hdc

A handle to the DC.

[in] nType

The object type. This parameter can be OBJ_BRUSH or OBJ_PEN.

[in] lpFunc

A pointer to the application-defined callback function. For more information about the callback function, see the EnumObjectsProc function.

[in] lParam

A pointer to the application-defined data. The data is passed to the callback function along with the object information.

Return value

If the function succeeds, the return value is the last value returned by the callback function. Its meaning is user-defined.

If the objects cannot be enumerated (for example, there are too many objects), the function returns zero without calling the callback function.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Device Context Functions

Device Contexts Overview

EnumObjectsProc

GetObject