IDirectDraw2::GetDisplayMode

HRESULT GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc);

Retrieves 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 that will be filled with a description of the surface.

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.