Platform SDK: DirectX

IDirectDraw7::EvaluateMode

The IDirectDraw7::EvaluateMode method is used after a call to IDirectDraw7::StartModeTest to pass or fail each mode presented by the test and to step through the modes until the test is complete.

HRESULT EvaluateMode(
  DWORD  dwFlags,
  DWORD  *pSecondsUntilTimeout
);

Parameters

dwFlags
Flags indicating the status of the mode being tested.
DDEM_MODEPASSED
The mode being tested has passed.
DDEM_MODEFAILED
The mode being tested has failed.
pSecondsUntilTimeout
A pointer to the DWORD that will receive a value denoting the seconds remaining before the current mode will be failed automatically unless it is explicitly passed or failed.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails or on completion, the method can return one of the following error values:

DDERR_TESTFINISHED
DDERR_NEWMODE
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_NOTFOUND

Remarks

The IDirectDraw7::EvaluateMode method can be used in conjunction with the IDirectDraw7::StartModeTest method to determine the maximum refresh rate that an EDID monitor and display adapter combination can support for each screen resolution.

Specifically, a call to IDirectDraw7::StartModeTest directs DirectDraw to establish a set of testable resolutions and to display a mode based on the first resolution in the set. Subsequent calls to IDirectDraw7::EvaluateMode can be used to pass or fail each mode and to advance the test to the next display mode. The method steps through the testable resolutions starting with the highest refresh rate supported for a given resolution. Once a refresh rate for a given resolution passes, testing of lower refresh rates for that resolution is skipped.

When the test is initiated, or whenever a mode is passed or failed, DirectDraw will begin a 15 second timeout. An application can monitor the time remaining without passing or failing the current mode by calling IDirectDraw7::EvaluateMode with a value of 0 for the dwFlags argument. Note that DirectDraw will only change modes or terminate the test when IDirectDraw7::EvaluateMode is called. However, if the method is called after the timeout period has elapsed, the current mode will be failed, regardless of the value provided for the dwFlags argument.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.

See Also

IDirectDraw7::StartModeTest, Refresh Rate Enumeration