IDirectDraw7::EnumDisplayModes method (ddraw.h)

Enumerates all the display modes that the hardware exposes through the DirectDraw object and that are compatible with a provided surface description.


HRESULT EnumDisplayModes(
  [in] DWORD                  unnamedParam1,
  [in] LPDDSURFACEDESC2       unnamedParam2,
  [in] LPVOID                 unnamedParam3,


[in] unnamedParam1

This value consists of one or more of the following flags:


Enumerates modes with different refresh rates. IDirectDraw7::EnumDisplayModes guarantees that a particular mode is enumerated only once. This flag specifies whether the refresh rate is taken into account when determining whether a mode is unique.


Enumerates Mode 13 in addition to the 320x200x8 Mode X mode.

[in] unnamedParam2

Address of a DDSURFACEDESC2 structure to be checked against available modes. If the value of this parameter is NULL, all modes are enumerated.

[in] unnamedParam3

Address of an application-defined structure to be passed to each enumeration member.

[in] unnamedParam4

Address of the EnumModesCallback2 function that the enumeration procedure calls every time a match is found.

Return value

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:



IDirectDraw7::EnumDisplayModes enumerates the dwRefreshRate member of the DDSURFACEDESC2 structure; the IDirectDraw::EnumDisplayModes method does not have this ability. If you use the IDirectDraw7::SetDisplayMode method to set the refresh rate of a new mode, use IDirectDraw7::EnumDisplayModes to enumerate the dwRefreshRate member.

IDirectDraw7::EnumDisplayModes differs from its counterparts in former interfaces in that it accepts the address of an EnumModesCallback2 function as a parameter, rather than an EnumModesCallback function.


Requirement Value
Target Platform Windows
Header ddraw.h
Library Ddraw.lib
DLL Ddraw.dll

See also