Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.69 KB

File metadata and controls

71 lines (53 loc) · 1.69 KB

rlsw - Windows Resolution Switcher

A lightweight Windows command-line tool for quickly switching display resolution and refresh rate.

README | 中文文档

Features

  • 🚀 Quick display settings switching
  • 💻 Custom resolution and refresh rate support
  • 🔧 Simple command-line interface
  • 📝 Persistent settings (registry update)

Usage

Basic Syntax

rlsw.exe [width] [height] [refresh_rate]

Parameters

Parameter Description Example
width Horizontal pixel count 1920
height Vertical pixel count 1080
refresh_rate Refresh rate in Hz 60

Example

Set display to 1920x1080 resolution with 60Hz refresh rate:

rlsw.exe 1920 1080 60

Return Codes

Code Description
0 Successfully changed settings
1 Already at target settings
Other Change failed

Building

Requirements

  • Windows OS
  • C compiler (GCC, MSVC, etc.)
  • Windows SDK

Build Commands

Using GCC (MinGW):

gcc -o rlsw.exe main.c -luser32

Using MSVC:

cl main.c user32.lib

Technical Details

This tool uses the following Windows API functions:

  • EnumDisplaySettings - Get current display settings
  • ChangeDisplaySettings - Change display settings
  • CDS_UPDATEREGISTRY - Flag to ensure persistent settings

Notes

  • Administrator privileges may be required to change display settings
  • Some resolution/refresh rate combinations may not be supported by your monitor
  • Ensure your hardware supports the target configuration before changing settings