Skip to content

About

A lightweight native Windows utility written in C++ and Win32 APIs that automatically changes display resolutions and refresh rates for specific applications and games.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

AutoRes Changer

A lightweight utility designed to automatically manage display resolutions and refresh rates for specific applications on Windows.

When launching older games, classic emulators, or modern competitive shooters, you often want your monitor to temporarily switch to a specific resolution or refresh rate. AutoRes Changer handles this process automatically in the background. It instantly detects when your configured program starts, changes the display settings, and safely restores your desktop to its original state the moment you close the program.

To ensure the lowest possible resource footprint on your system, AutoRes Changer is built entirely with native C++ and Win32 APIs. It does not run on bloated background frameworks, consuming less than 1 MB of RAM while resting silently in your system tray.


Quick Setup Guide

Follow these steps to set up or compile AutoRes Changer on your computer.

Option A: Download Pre-compiled Packages

You do not need to compile the code manually. You can download the standalone executable immediately:

  1. Go to the Release section on this repository page.
  2. Download the latest AutoResChanger.exe file.
  3. Place it anywhere on your computer and run it. No installation is required.

Option B: Compile from Source

If you prefer to compile the application yourself using a lightweight compiler like MSYS2/MinGW-w64:

Step 1: Prepare the Files

  1. Create a folder on your computer named AutoResChanger.
  2. Save your C++ source code as main.cpp inside this folder.
  3. Save your resource script as resource.rc inside this folder.
  4. Place any custom icon file you want to use inside the folder and name it app.ico.

Step 2: Compile the Program

Pick whichever build method you prefer.

Easiest: double-click build.bat. It auto-detects the MinGW toolchain, compiles the resource and the program, and leaves AutoResChanger.exe next to the script — no terminal needed. If the compiler isn't found it prints exactly what to install.

PowerShell script. build.ps1 does the same with a few extra options:

.\build.ps1              # release build
.\build.ps1 -Debug       # debug build with symbols
.\build.ps1 -Clean       # remove build artifacts first

CMake. A CMakeLists.txt is provided for both MinGW-w64 and MSVC:

cmake -S . -B build -G "MinGW Makefiles"
cmake --build build
ctest --test-dir build --output-on-failure   # run unit tests

Manual (MinGW-w64). Run the resource compiler, then the C++ compiler. Note that -municode and linking resource.res are required so the Unicode resource APIs resolve correctly:

windres resource.rc -O coff -o resource.res
g++ -O2 -Wall -Wextra main.cpp resource.res -o AutoResChanger.exe -mwindows -municode -static -luser32 -lgdi32 -lshell32 -lcomdlg32 -ladvapi32 -ldwmapi -luxtheme -lole32 -lcomctl32

-static links the C/C++ runtime into the executable, so the finished .exe needs no libstdc++/libgcc DLLs next to it and stays portable wherever you drop it. (MSVC builds use /MT for the same reason.)

A GitHub Actions workflow (.github/workflows/build.yml) automatically builds the executable and runs both the unit and GUI tests on every push, then attaches the binary to a release whenever you push a v* tag.


Testing

AutoRes Changer ships with two layers of automated tests:

  • Headless unit tests (tests/test_main.cpp) cover the pure logic: path parsing, config save/load round-trips, atomic-write cleanliness, mode enumeration, and process detection. They compile with -DTESTING, which excludes the GUI. Run them via ctest (see above) or:
    .\tests\run_tests.ps1
  • GUI end-to-end tests (tests/gui_save_test.ps1) drive the real window through Win32 messages to prove the full Save/Delete/validation flow writes the correct config.ini with no leftover temp files:
    .\tests\run_tests.ps1 -Gui

How to Use

Managing your custom application profiles is straightforward and handled entirely through a clean, resizable graphical interface.

Creating a Profile

  1. Launch AutoResChanger.exe.
  2. Click the ... browse button next to the Executable Path field and select the .exe file of the game or program you want to configure. You can also simply drag and drop an .exe from Explorer onto the window.
  3. Select which screen you want to modify from the Target Display drop-down list (supports multi-monitor setups).
  4. Pick a resolution in one of two ways:
    • Supported Modes — a live list read directly from the selected monitor, so every entry is guaranteed to be supported.
    • Resolution Template / Presets — a curated list of common resolutions, or type custom dimensions manually into the Width, Height, and Hz input fields.
  5. Click Save Profile. Your new configuration will appear in the left-hand profile list (with the target app's own icon).

Testing Modes Safely

If you want to verify whether a custom resolution or refresh rate is supported by your monitor before saving it:

  1. Input your target dimensions or select an existing profile.
  2. Click the Test Display Settings button. The button becomes Keep This Mode and a countdown starts.
  3. Your screen temporarily transitions to the selected mode.
  4. Click Keep This Mode to confirm, or simply do nothing — after 15 seconds the utility automatically reverts to your original desktop settings. This guarantees you can always recover even if the tested mode renders your display unreadable.

Validation feedback (missing path, invalid resolution, unsupported mode) is shown in a non-blocking status line beneath the buttons rather than a pop-up dialog, so the interface never traps you.


Understanding Key Features

AutoRes Changer includes several features to accommodate complex setups and game behaviors:

  • Multi-Monitor Routing: Instead of changing settings globally, you can assign target resolutions to specific displays. The utility reads your active hardware configuration to target individual monitors cleanly.
  • Live Supported Modes: The Supported Modes drop-down is populated on the fly from your selected monitor via EnumDisplaySettings, so you can see exactly which resolutions and refresh rates your hardware actually offers before saving.
  • Startup Delay (Grace Period): Some games load an initial splash screen or configuration launcher before launching the actual game window. Setting a Delay (in seconds) tells the utility to wait until the primary game window is fully loaded before executing the resolution override.
  • Input Validation: Width and Height are validated before a profile is saved or tested, preventing accidental zero-sized or malformed modes.
  • Single Instance: Only one copy of AutoRes Changer can run at a time, so launching it twice never leaves duplicate tray icons or competing monitors fighting over your display settings.
  • Auto-Start on Boot: Checking Start automatically with Windows registers the application in your local user workspace. Upon system boot, it launches silently in the background and rests minimized in your system tray without interrupting you.
  • Dark Mode & Diagnostic Logging: Toggle a dark UI theme and an optional diagnostic log (written to %APPDATA%\AutoResChanger\log.txt) that records each detection, mode change, and failure — handy when troubleshooting a stubborn game.
  • Per-Monitor DPI Aware: Uses the modern per-monitor-v2 DPI context so the interface stays crisp on mixed-DPI and high-refresh setups.
  • Exact Process Matching: A profile only fires for the exact executable you configured — matching is done on the full image path, so an unrelated setup.exe or launcher.exe elsewhere on your disk can never trigger it.
  • No External Dependencies: The binary is statically linked: it has no DLL dependencies beyond the Windows system ones, so a DLL dropped next to the executable in a shared folder can never be loaded in its place.

Background Behavior & Reversion Safety

  • Minimizing to Tray: Closing the configuration window via the standard close button does not exit the utility. It hides the interface to the system tray so that monitoring remains active. To restore the window, simply double-click the system tray icon near your clock.
  • Tray Quick Actions: Right-clicking the tray icon offers Open window, Restore resolution now (instantly reverts if a profile change is currently active, enabled only when one is), Open config folder, and Exit AutoRes Changer.
  • Guaranteed Restoration: If a profile is active (i.e. your resolution is currently changed) and you exit the utility — or log off / shut down Windows — the original desktop resolution is restored automatically first. You will never be left stuck at a game resolution after closing AutoRes Changer.
  • Crash-Safe Restoration: Windows does not undo a dynamic display-mode change when the process that made it dies — a crashed or force-killed AutoRes Changer would otherwise leave your desktop stuck at the game's resolution. So every mode change arms a small watchdog: a second copy of the executable that waits for the main process to exit and puts your original mode back. The watchdog only acts if the display still shows the mode we set, so a resolution you changed yourself is never overwritten.
  • Emergency Reversion: The display modifications are applied using standard Windows dynamic sessions (CDS_FULLSCREEN). This design choice means that your custom resolutions are not permanently written to your Windows registry — a reboot always returns to the default desktop resolution.

Maintenance & Removal

Managing Configurations

Your application profiles are saved cleanly in a standard configuration file on your system.

  • You can find your saved settings at: %APPDATA%\AutoResChanger\config.ini
  • An optional diagnostic log (when Enable diagnostic logging is checked) is written to %APPDATA%\AutoResChanger\log.txt.
  • To clear all profiles or start fresh, you can simply delete the config.ini file or the parent AutoResChanger directory inside your AppData folder.

Complete Removal

Because the utility is entirely portable, uninstallation is clean:

  1. Open the program interface and uncheck the Start automatically with Windows option to remove the startup registration from your registry.
  2. Right-click the system tray icon and select Exit AutoRes Changer to stop the background monitor.
  3. Delete the folder containing AutoResChanger.exe. No leftover application files or secondary system configurations will remain on your computer.

Changelog

Release notes for every version live in CHANGELOG.md, and the same notes are attached to each GitHub release.


Security Notes

AutoRes Changer runs as a normal, unelevated user process. It never asks for administrator rights and never needs them.

  • No network access. The utility never connects to the internet; there is no telemetry, no update check and no crash reporting.
  • Everything stays local. The only files written are %APPDATA%\AutoResChanger\config.ini (your profiles) and, when enabled, %APPDATA%\AutoResChanger\log.txt. The only system change is the optional per-user auto-start entry in HKCU\Software\Microsoft\Windows\CurrentVersion\Run.
  • Your config file is untrusted input. config.ini lives in a folder any program running as you can write to, so every value read from it is range-checked before it is handed to the display driver.
  • Profiles match on the full path. Detection compares the full image path of the running process with the path you configured, so a look-alike game.exe somewhere else on the disk cannot hijack a profile.
  • Single-file executable. The release binary is statically linked and imports nothing but Windows system DLLs, so there is no DLL search-order hijacking surface next to the .exe.
  • CI supply chain. The GitHub Actions workflow pins every third-party action to a commit SHA and grants the build job read-only repository permissions; only the release job may write.

License (Click to expand)

This project is open-source and distributed under the MIT License.

About

A lightweight native Windows utility written in C++ and Win32 APIs that automatically changes display resolutions and refresh rates for specific applications and games.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages