Platform SDK: DirectX |
The IDirectDraw7::StartModeTest method initiates a test to update the system registry with refresh rate information for the current display adapter and monitor combination. A call to this method is typically followed by calls to IDirectDraw7::EvaluateMode to pass or fail modes displayed by the test.
HRESULT StartModeTest( LPSIZE lpModesToTest, DWORD dwNumEntries, DWORD dwFlags );
If the method succeeds, the return value is DD_OK.
If it fails, the method can return one of the following error values:
DDERR_CURRENTLYNOTAVAIL |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_NOEXCLUSIVEMODE |
DDERR_NOTFOUND |
DDERR_TESTFINISHED |
When the method is called with the DDSMT_ISTESTREQUIRED flag, it can return one of the following values:
DDERR_NEWMODE |
DDERR_NODRIVERSUPPORT |
DDERR_NOMONITORINFORMATION |
DDERR_TESTFINISHED |
The IDirectDraw7::StartModeTest method can be used in conjunction with the IDirectDraw7::EvaluateMode method to determine the maximum refresh rate that an EDID monitor and display adapter combination can support for each screen resolution. The results of the testing are stored in the system registry and affect the operation of IDirectDraw7::EnumDisplayModes when that method is called with the DDEDM_REFRESHRATES flag set.
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.
This method will only succeed with monitors that contain EDID data. If the monitor is not EDID-compliant, then the method will return DDERR_TESTFINISHED without testing any modes. If the EDID table does not contain values higher than 60 Hz, no modes will be tested. Refresh rates higher than 100 Hz will only be tested if the EDID table contains values higher than 85 Hz.
Calling the method with an argument list of (NULL, 0, 0) will clear existing refresh rate information from the registry.
The test will not guarantee to display only the resolutions in the array described by the lpModesToTest and dwNumEntries parameters. For example, the 640×480 resolution is used to obtain a maximum viewable refresh rate for the 320×200 resolution.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 98.
Header: Declared in ddraw.h.