To initiate a dynamic resolution change when the user presses a hot key to switch between the LCD panel of a laptop and an external monitor (CRT), you must write a virtual device (VxD) that has the following capabilities:
In response to the monitor change message, Windows 95 calls the current display driver to find out if the resolution in the registry is still valid. Because the resolution in the registry is likely to be higher than the resolution that the LCD can handle (typically 640- by 480-pixels), the driver should fail at resolutions set higher than 640 by 480 if the LCD is being enabled. Windows 95 should then call the driver to set 640- by 480-pixels as the resolution. The system will automatically adjust windows and icons and notify applications of the resolution change. This scenario is identical to the user changing the resolution to 640- by 480-pixels using the Display Properties dialog box.
Note that when the resolution changes dynamically, the resolution setting in the registry does not change. If the user later presses the hot key to change back to CRT-only mode, the high resolution setting in the registry will be validated by the driver, and Windows 95 will change back to it.
The display driver should not attempt to change the resolution itself since the Windows 95 shell must track resolution changes to maintain the appearance of the desktop and to notify applications. Display drivers should wait for the system to request a change in resolution.
A VxD has the option of specifying a particular resolution in a call to BROADCAST_DEVICE_CHANGE. One reason for specifying one is to support LCD panels capable of resolutions up to 800- by 600-pixels. If the VxD does not specify 800 by 600 as the resolution when enabling the LCD, Windows 95 will automatically specify the highest resolution the device is configured for, (usually 640- by 480-pixels) as the resolution for the display driver to validate and switch to.
Note that for Windows 95, the Display Properties dialog box is unable to track the monitor type when the user switches between the LCD and CRT by pressing a hot key. This limitation will be addressed in future versions of Windows.