Change-Resolution V0.1

This is most sophisticated command-line tool to change the resolution on Windows 95/NT4 and newer. (Also NT3.5 may work but totally untested)

The main strength is the resolution parser, it is simple and easy for the beginner and take the data in any order.
If started without any arguments then it will show this short reference and the current resolution(s):

--------------------------------------------------------------------------------
CRES cXXXXxYYYY@BB:RRR (Display)
 c=How to apply, if left out then the registry for current user is updated.
 (?:Test for 15s, Q:Query driver, N=Don't update registry, G=Set for all users)
 XXXX=Horizontal resolution, [x]YYYY=Vertical resolution, [@]BB=Bits per pixel.
 [:]RRR=Refresh rate in Hz, (Display)=\\.\DISPLAY1 or just 1, optional.
 Adding an I will set the interlaced flag on the requested mode.
 Undefined values default to the current setting.

CurrentConfig is REG_DWORD, WinNT detected.
1600x1200@32:160
768x576@32:50
--------------------------------------------------------------------------------

You can see the default layout of the parameter along with the additional option to specify an alternative monitor.
By default it is primary one: \\.\DISPLAY1 
If you just write a number then it will be appended internally to \\.\DISPLAY but if it starts with '\' then the entire string will be used. 
This allows for changing 'virtual' monitors like the NetMeeting driver (\\.\DISPLAYV1).
Also keep in mind that this option is only available in Windows 2000 and newer. 
Multi-monitor support for Windows 98 was abandoned as driver issues with my ATI Radeon 7500 caused me too many problems involving non-VGA frequencies.

As for the resolution parameter which is LIMITED TO 25 CHARACTERS (for now).
c Suggests on how to the display mode should be changed: 
	? This changes the resolution and waits 15 seconds then restores the previous one
	Q Only asks the driver if the resolution is acceptable
	N Tells the Windows not to save it and the last saved one will be used after a system restart
	G This saves the resolution for all users

XXXX     is the horizontal resolution, any number that has no special prefix will be assumed to be this.
[x]YYYY  is the vertical resolution with the prefix 'X'.
[@]BB    is bits per pixel with the prefix '@'.
[:]RRR   is the refresh rate in Hz with the prefix ':'.
An i can be added to set the interlaced flag. Certain drivers demand it to be set for interlaced resolutions.
Keep in mind that the number length is limited as written above.

All these values can be in any order, all what matters is the prefix for the numbers and that the numbers are written in one whole piece. 
A '-' can serve as escape character to allow the horizontal resolution to be placed after another value.

Then the tool prints out which type of Windows is detected (via the registry).
The currently used resolution(s) (max. 16 monitors) which is output in a the same format as the input. This allows for simple and quick copy pasting.

Some (silly) examples:
x600-800            Keep bit depth and refresh rate and set 800x600
:85@8               Keep resolution and change refresh rate to 85hz and the bit depth to 8bpp
@16-640-800:60x600  800x600 at 16bpp and 60hz as the previously parsed horizontal 640 pixels was overwritten with 800 pixels
i                   Keep resolution, bit depth and refresh rate but set the interlaced flag (I'll highly doubt that it will work)
1024                Keep vertical resolution, bit depth and refresh rate but set horizontal resolution to 1024 pixels
:150                Keep resolution, bit depth but set the refresh rate to 150Hz
640x480?	    Keep bit depth and refresh rate but set 640x480 for 15 seconds and then restore the previous resolution
1920qX1200          Ask the driver if 1920x1200 is supported at the current bit depth and refresh rate
320x200-1024x768    1024x768 at the current bit depth and refresh rate as previously parsed 320x200 was overwritten



It will also print out neat technical information and simple errors during normal usage.
The previous and the new resolution, bit depth and refresh rate will be shown, also in the same format as the input.
So it will tell if it used ChangeDisplaySettingsEx as it was available (Win98/2000) instead of ChangeDisplaySettings.
The countdown will be shown as it ticks by: "Reverting back to the previous resolution in N seconds", you could abort it by pressing Ctrl+C.
After normal operation the output value from Windows will be directly returned:
#define DISP_CHANGE_SUCCESSFUL      0
#define DISP_CHANGE_RESTART         1
#define DISP_CHANGE_FAILED          (-1)
#define DISP_CHANGE_BADMODE         (-2)
#define DISP_CHANGE_NOTUPDATED      (-3)
#define DISP_CHANGE_BADFLAGS        (-4)
#define DISP_CHANGE_BADPARAM        (-5)
#define DISP_CHANGE_BADDUALVIEW     (-6)


Notes about refresh rate and Windows 9x:
This is not set via ChangeDisplaySettings(Ex) like in Windows 2000 and is very driver dependant.
However, it is set via the registry and this is (likely) the only command-line tool that reads the current hardware profile and determines the path to the graphics card driver to set the refresh rate per each resolution + bit depth as demanded.
It will let you know that it couldn't find the resolution in the registry and suggests to to add the key yourself, however I can't tell you if it actually works that way.
The only GPU that was tested with this under Win98 was a ATI Radeon 7500 installed in a fancy and oversized laptop docking station hence the reason for dealing with hardware profiles to avoid conflicting with the unused and disabled Laptop GPU.


T. Sosnow. <t-sosnow@posteo.com>
Visit QWERTZ-tek at http://qwertz.w10.site/ for my other stuff
May 6, 2026
