IDirectDraw2::GetDisplayMode

The IDirectDraw2::GetDisplayMode method retrieves the current display mode.

HRESULT GetDisplayMode(
  LPDDSURFACEDESC lpDDSurfaceDesc  
);
 

Parameters

lpDDSurfaceDesc
Address of a DDSURFACEDESC structure that will be filled with a description of the surface.

Return Values

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
DDERR_UNSUPPORTEDMODE

Remarks

An application should not save the information returned by this method to restore the display mode on clean-up. The application should use the IDirectDraw2::RestoreDisplayMode method to restore the mode on clean-up, thereby avoiding mode-setting conflicts that could arise in a multiprocess environment.

QuickInfo

  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.

See Also

IDirectDraw2::SetDisplayMode, IDirectDraw2::RestoreDisplayMode, IDirectDraw2::EnumDisplayModes