IDirectDraw::GetDisplayMode

HRESULT GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc);

Returns the current display mode.

·Returns DD_OK if successful, or one of the following error values otherwise:

DDERR_INVALIDOBJECT DDERR_INVALIDPARAMS
DDERR_UNSUPPORTEDMODE  

lpDDSurfaceDesc

Address of a DDSURFACEDESC structure to be filled in with a description of the surface.

An application should not save the information returned by IDirectDraw::GetDisplayMode to restore the display mode on clean up. The mode restoration on clean up should be performed with IDirectDraw::RestoreDisplayMode, thereby avoiding mode setting conflicts that could arise in a multiprocess environment.