The IDirectDraw4::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,
LPDDSURFACEDESC2 lpDDSurfaceDesc2,
LPVOID lpContext,
LPDDENUMMODESCALLBACK2 lpEnumModesCallback
);
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 DDSURFACEDESC2 structure; the IDirectDraw::EnumDisplayModes method does not contain this capability. If you use the IDirectDraw4::SetDisplayMode method to set the refresh rate of a new mode, you must use IDirectDraw4::EnumDisplayModes to enumerate the dwRefreshRate member.
This method 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.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.
IDirectDraw4::GetDisplayMode, IDirectDraw4::SetDisplayMode, IDirectDraw4::RestoreDisplayMode