Tired of using the Windows Control panel to quickly change your graphics cards display mode. This program uses the command line sent to it, to change the display mode. With this structure you can create a number of shortcuts to ResSwitch on your desktop using different command lines which will allow you to change mode with a simple double click on your desktop. By setting up shortcut keys in the shortcut file to ResSwitch you can quickly change modes by just using the keyboard only.
Also included is ResCopy which is a simple dialog based app which lists all the display devices and available display modes which ResSwitch can use. It also allows a filename to be specified via its command line, using this will just output the available display devices and display modes to that file a line at a time without displaying the dialog.
Included in the download is the source code to the ResSwitch, and ResCopy apps, and some MFC classes to wrap access to the two underlying API's ResSwitch and ResCopy uses and a prebuilt binary version of both programs. The enclosed binary requires that you have the MFC 6 DLLs already installed. If you haven't already got them on your machine (MFC42.DLL in your Windows system directory), then grab them from http://www.naughter.com/download/vcredist.exe
Usage |
Copyright |
History |
API Reference |
Contacting the Author |
Parameter | Description |
Width | The new width of the display in pixels. Corresponds to DEVMODE::dmPelsWidth. |
height | The new height of the display in pixels. Corresponds to DEVMODE:dmPelsHeight |
frequency | The new display frequency to use in hertz. Corresponds to the DM_DISPLAYFREQUENCY flag. |
depth | The new color depth to set. e.g. 4 for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors, 24 for 16 million colors etc |
positionX | The X coordinate in pixels to set the location of a display device in a multi monitor setup. Corresponds to DEVMODE::dmPosition::x |
positionY | The Y coordinate in pixels to set the location of a display device in a multi monitor setup. Corresponds to DEVMODE::dmPosition::y |
device | The name of the display device on which this operation should take place. Please use ResCopy to obtain the list of possible devices in a multi monitor setup. |
detach | Specifying this flag causes the specified display device to be detached / deactivated. |
primary | Specifying this flag causes the specified display device to be made the primary display device. Corresponds to the CDS_SET_PRIMARY flag. |
test | Specifying this flag causes the operation to only be tested for success as opposed to actual doing the operation. Corresponds to the CDS_TEST flag. |
updateregistry | Specifying this flag causes the new settings to be updated in the registry. Corresponds to the CDS_UPDATEREGISTRY flag. |
noreset | Specifying this flag causes the new settings to be updated in the registry, but will not take effect. Corresponds to the CDS_NORESET flag. |
global | Specifying this flag causes the new settings to be updated in the registry so that it will affect all users on the machine and not just for the current user. Corresponds to the CDS_GLOBAL flag. |
reset | Specifying this flag causes the new settings to be changed, even if the requested settings are the same as the current settings. Corresponds to the CDS_RESET flag. |
v1.1 (25 September 1997)
v1.2 (4 January 1999)
v1.21 (6 March 2000)
Now included is ResCopy (instead of ResList) which is a simple dialog based app which lists the available video modes which ResSwitch can use. It also allows a filename to be specified via its command line, using this will just output the available video modes to that file a line at a time without displaying the dialog.
v1.22 (17 January 2001)
v1.23 (2 April 2007)
v1.24 (12 March 2008)
The API consists of the public member functions of the simple classes CDisplayDevice, CDisplayMode, CAvailableDisplayDevices & CAvailableDisplayModes
CAvailableDisplayDevices::Get
CAvailableDisplayModes::GetCurrentForPrimaryDisplay
CAvailableDisplayModes::GetAvailable
static BOOL CAvailableDisplayDevices::Get(CDisplayDevices& devices);
Return Value
TRUE if the display devices was retrieved successfully otherwise FALSE.
Parameters
devices Upon successful return this will contain an array representing all the display devices enumerated.
CAvailableDisplayModes::GetCurrentForPrimaryDisplay
static BOOL CAvailableDisplayModes::GetCurrentVideoMode(CDisplayMode& mode);
Return Value
TRUE if the display mode for the primary display was retrieved successfully otherwise FALSE.
Parameters
mode Upon successful return this will contain the current video mode of the primary display.
Remarks
Internally this retrieves the current settings GetDeviceCaps function on a device context for the primary display. Note that because the code is using GetDisplayCaps the returned display mode will not have any DisplayFlags set. If you want to find the Display Flags for the primary display, then call CAvailableDisplayDevices::Get and find the display device in the returned array which has the DISPLAY_DEVICE_PRIMARY_DEVICE flag set.
CAvailableDisplayModes::GetAvailable
static BOOL CVideoModes::GetAvailable(LPCTSTR pszDeviceName, CDisplayModes& modes);
Return Value
TRUE if the available video modes were retrieved successfully otherwise FALSE.
Parameters
pszDeviceName The display device name to get its display nodes. This value should be taken from CDisplayDevice::m_sDeviceName or left NULL if you want to retrieve the the display modes for the primary display.
modes Upon successful return this will contain an array containing all the available display modes of the specified display device.
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
12 March 2008