IDirectDraw7::EnumDisplayModes method

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

Syntax

HRESULT EnumDisplayModes(
  DWORD                  ,
  LPDDSURFACEDESC2       ,
  LPVOID                 ,
  LPDDENUMMODESCALLBACK2 
);

Parameters

arg1

arg2

arg3

arg4

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:

  • DDERR_INVALIDOBJECT
  • DDERR_INVALIDPARAMS

Remarks

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.

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the IDirectDraw7::EnumDisplayModes method.

Requirements

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

See Also

IDirectDraw7