resswitch.gif (383 bytes)ResSwitch & ResCopy v1.24 2 freeware utilities including MFC source code to enumerate and change displays modes

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

 

 

 

Usage

 

 

 

Copyright

 

 

 

History

v1.1 (25 September 1997)

v1.2 (4 January 1999)

v1.21 (6 March 2000)

v1.22 (17 January 2001)

v1.23 (2 April 2007)

v1.24 (12 March 2008)

 

 

 

API Reference

The API consists of the public member functions of the simple classes CDisplayDevice, CDisplayMode, CAvailableDisplayDevices & CAvailableDisplayModes

CAvailableDisplayDevices::Get
CAvailableDisplayModes::GetCurrentForPrimaryDisplay
CAvailableDisplayModes::GetAvailable
 

CAvailableDisplayDevices::Get

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.

 

 

 

Contacting the Author

PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
12 March 2008