ValidateMode

include valmode.inc
UINT WINAPI ValidateMode(DISPLAYINFO FAR *lpValMode);
 

Allows display drivers to accept or reject a mode selected by the user.

Value Meaning
VALMODE_YES Valid mode.
VALMODE_NO_WRONGDRV Driver does not work on adapter.
VALMODE_NO_NOMEM Not enough video memory for settings.
VALMODE_NO_NODAC DAC can not handle selected colors.
VALMODE_NO_UNKNOWN Unknown problem.

lpValMode
Address of a DISPLAYINFO structure that specifies the mode information such as resolution and color depth selected by the user.

All mode validation must be done in a manner that does not affect the screen.

ValidateMode can be called even if the driver is not the currently running display driver. If the user specifies a resolution/color depth that requires Windows to switch to a new driver, Windows will first call LoadLibrary on the new driver and call ValidateMode to verify that the new color depth/resolution is possible.

Display drivers must use the name "ValidateMode" in the .DEF file; since Windows dyna-links to this function by name, not by ordinal.

Ordinal 700 is the recommended value for this function.

See Also

DISPLAYINFO