The IDirectDraw2::EnumDisplayModes method enumerates all of the display modes the hardware exposes through the DirectDraw object that are compatible with a provided surface description.
HRESULT EnumDisplayModes(
DWORD dwFlags,
LPDDSURFACEDESC lpDDSurfaceDesc,
LPVOID lpContext,
LPDDENUMMODESCALLBACK lpEnumModesCallback
);
DDEDM_REFRESHRATES | Enumerates modes with different refresh rates. IDirectDraw2::EnumDisplayModes guarantees that a particular mode will be enumerated only once. This flag specifies whether the refresh rate is taken into account when determining if a mode is unique. |
DDEDM_STANDARDVGAMODES | Enumerates Mode 13 in addition to the 320x200x8 Mode X mode. |
If the method succeeds, the return value is DD_OK.
If the method fails, the return value may be one of the following error values:
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
This method enumerates the dwRefreshRate member of the DDSURFACEDESC structure; the IDirectDraw::EnumDisplayModes method does not contain this capability. If you use the IDirectDraw2::SetDisplayMode method to set the refresh rate of a new mode, you must use IDirectDraw2::EnumDisplayModes to enumerate the dwRefreshRate member.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.
IDirectDraw2::GetDisplayMode, IDirectDraw2::SetDisplayMode, IDirectDraw2::RestoreDisplayMode