Close any window with Ctrl+W - just like in your browser!
Installation โข How to Use โข Customize โข Troubleshooting โข FAQ
Building this because windows didnt. Universal hotkey that will Close any Windows program with Ctrl+W.
If you use a web browser, you know that Ctrl+W closes tabs instantly. But try it in Notepad, Paint, or others.. nothing happens.
Better Ctrl+W makes Ctrl+W work everywhere.
| Feature | What it does |
|---|---|
| ๐ช Universal Window Closing | Press Ctrl+W to close any window, anywhere |
| ๐ง Smart Exclusions | Automatically skips browsers and apps that already use Ctrl+W |
| ๐ฎ Fullscreen Protection | Won't close your games or fullscreen videos |
| ๐ Auto-Start Option | Optionally starts with Windows - set it and forget it |
| โ๏ธ Fully Customizable | Easy config file to add or remove exclusions |
New to Better Ctrl+W? Start here:
- Download & Install โ Get
BetterCtrlW-Setup.exefrom releases - Run it โ Double-click the installer, click Next a few times.
- Configure it โ Update & reload config.
- Done โ Universal CtrlW functionality within non-excluded apps.
- Optional: Auto-start โ Right-click tray icon โ Check "Start with Windows"
Quick Tips:
- ๐ก Config File: Edit
C:\Users\{username}\AppData\Local\Better Ctrl+W - ๐ก Disable: Right-click tray icon โ Exit
TL;DR: Download โ Double-click โ Done!
- Download
BetterCtrlW-Setup.exefrom the Releases Page โฌ๏ธ - Run the installer (double-click the downloaded file)
- Click through the wizard (Next โ Next โ Install)
| What | Where |
|---|---|
| Settings | C:\Users\{username}\AppData\Local\Better Ctrl+W |
| Start Menu Shortcut | Search "Better Ctrl+W" in Start Menu |
| Uninstaller | Windows Settings โ Apps โ Installed apps |
Once installed, nothing to configure - just start pressing Ctrl+W to close windows!
๐ฅ Notepad closes instantly!
Better Ctrl+W passes through in these apps (Ctrl+W works normally):
| App Type | What Happens |
|---|---|
| ๐ Web Browsers | Ctrl+W closes tabs (Chrome, Firefox, Edge, etc.) |
| ๐ป Code Editors | Ctrl+W closes tabs/files (VS Code, Notepad++, etc.) |
| ๐ฅ๏ธ IDEs | Normal Ctrl+W behavior preserved |
| ๐ฎ Fullscreen Games | Ignored completely (won't close your game!) |
| ๐บ Fullscreen Videos | Ignored (won't interrupt your movie) |
Right-click the tray icon to access settings:
- Reload Config - Reload settings after changing the config file
- Start with Windows - Check this to run Better Ctrl+W every time you start your computer
- Exit - Close the application
Better Ctrl+W is already configured to skip apps that use Ctrl+W for their own purposes (like closing browser tabs). But you can customize this list!
These apps are excluded by default, so Ctrl+W works normally in them:
- Web Browsers: Chrome, Firefox, Edge, Brave, Opera, Vivaldi
- Code Editors: VS Code, Visual Studio, Notepad++, Sublime Text, Atom
- Developer Tools: PyCharm, WebStorm, IntelliJ, Eclipse, Rider
- Microsoft Office: Word, Excel, PowerPoint, Outlook
- Terminals: Command Prompt, PowerShell, Windows Terminal
- Communication: Discord, Slack, Teams
- Other: Spotify, Steam, File Explorer
Step 1: Find the Config File
The settings are stored in a file called Config.json located at:
C:\Users\{username}\AppData\Local\Better Ctrl+W
Step 2: Open It in Notepad
- Right-click the Better Ctrl+W tray icon โ Exit (the app must be closed first)
- Press Windows Key + R to open Run
- Type:
notepad "C:\Users\{username}\AppData\Local\Better Ctrl+W" - Press Enter
Step 3: Edit the List
You'll see something like this:
{
"ExcludedProcesses": [
"chrome",
"firefox",
"code",
"notepad++"
],
"AutoStartupEnabled": false
}- To add an app: Add a line with the app's process name (see below)
- To remove an app: Delete the line with that app's name
Step 4: Find an App's Process Name
If you want to exclude a specific app:
- Open the app you want to exclude
- Press Ctrl+Shift+Esc to open Task Manager
- Click the "Details" tab
- Find your app in the list - the "Name" column shows the process name
- Remove the
.exepart (e.g.,myapp.exeโ usemyapp)
Step 5: Save and Reload
- Save the file in Notepad (Ctrl+S)
- Close Notepad
- Start Better Ctrl+W again from the Start Menu
- Your changes are now active!
Example: Excluding Photoshop
If you want Ctrl+W to NOT close Photoshop windows:
- Open Photoshop
- Check Task Manager โ Details tab โ Find "Photoshop.exe"
- Add
"photoshop"to the list in Config.json:
{
"ExcludedProcesses": [
"chrome",
"firefox",
"photoshop"
],
"AutoStartupEnabled": false
}| Shortcut | What it does |
|---|---|
| Ctrl+W | Close current window (in non-excluded apps) |
| Ctrl+Shift+Esc | Open Task Manager (to find process names) |
| Windows Key + R | Open Run dialog (to edit Config.json) |
| Alt+F4 | Close window (still works as backup!) |
๐ก Create custom exclusions - If you have a work app where you don't want Ctrl+W to close windows, just add it to the config!
๐ก Use with AutoHotkey - Better Ctrl+W works great alongside other keyboard automation tools
๐ก Perfect for multi-monitor setups - Quickly close windows across all your screens
๐ก Great for cleaning up clutter - Have 20 File Explorer windows? Ctrl+W through them in seconds!
No! Alt+F4 still works exactly as before. Better Ctrl+W just gives you an additional, more convenient option.
Absolutely not! Better Ctrl+W is pre-configured to skip all major browsers. In Chrome, Firefox, Edge, etc., Ctrl+W will continue to close tabs normally.
Yes! Just right-click the tray icon and select "Exit". Launch it again from the Start Menu when you want it back.
Yes! Better Ctrl+W works alongside other keyboard automation tools without conflicts.
Windows protects certain system windows (like Task Manager) from being closed by third-party apps. This is a security feature built into Windows.
Yes! Works perfectly on both Windows 10 and Windows 11.
Yes! Just install it on each computer. The config file is separate for each installation.
Absolutely. Better Ctrl+W runs completely offline, collects no data, and has no internet access. It only monitors for Ctrl+W keypresses to close windows.
Click to expand troubleshooting steps
Step 1: Check if the app is running
- Look for the Better Ctrl+W icon in your system tray (bottom-right corner, near the clock)
- Don't see it? Click the up arrow (^) to show hidden icons
- Still not there? Open it from the Start Menu (search "Better Ctrl+W")
Step 2: Test in a simple app
1. Press Windows Key
2. Type "notepad"
3. Press Enter to open Notepad
4. Press Ctrl+W
5. โ
Notepad should close instantly
Step 3: Check if you're in fullscreen
- Better Ctrl+W won't close fullscreen windows (games, videos, presentations)
- Press Escape or F11 to exit fullscreen, then try Ctrl+W again
Step 4: Check if the app is excluded
- The program might be on the exclusion list (see Config.json)
- This is normal for browsers, code editors, and terminals
The program is probably excluded - here's how to check
This is normal for browsers and code editors! They're intentionally excluded.
To check if a program is excluded:
- Right-click the tray icon โ Exit
- Press Windows Key + R
- Type:
notepad "C:\Users\{username}\AppData\Local\Better Ctrl+W" - Press Enter
- Look for the program name in the
ExcludedProcesseslist - Remove it if you want Ctrl+W to close that program
- Save (Ctrl+S) and restart Better Ctrl+W
Try this fix
- Right-click the tray icon
- Make sure "Start with Windows" has a checkmark โ
- Try unchecking it, then checking it again
- Restart your computer to test
- If still not working, the registry entry might need manual attention (see developer section)
This is normal - Windows security feature
Some Windows system windows are protected by Windows and cannot be closed by third-party programs. This includes:
- Task Manager
- Windows Security
- UAC dialogs
- System Settings (some windows)
This is a security feature built into Windows to prevent malicious programs from closing critical system windows.
Workaround: Use Alt+F4 for these protected windows.
Open an issue on GitHub with:
- What you were trying to do
- What happened (or didn't happen)
- What app you were using
- Screenshots if possible
Method 1: Windows Settings
1. Press Windows Key
2. Type "Add or remove programs"
3. Find "Better Ctrl+W"
4. Click โ Uninstall
5. Confirm
Method 2: Settings App
Settings โ Apps โ Installed apps โ Better Ctrl+W โ โฎ โ Uninstall
The uninstaller removes everything automatically including:
- โ The program file
- โ The configuration file
- โ Start Menu shortcuts
- โ Auto-startup registry entry (if enabled)
Yes! Better Ctrl+W is designed with privacy and security in mind.
| Feature | Details |
|---|---|
| ๐ Completely Offline | No internet connection needed or used |
| ๐ซ Zero Data Collection | Doesn't send any information anywhere |
| ๐๏ธ Open Source | All code is publicly available on GitHub for review |
| ๐ก๏ธ No Admin Rights | Runs with standard user permissions |
| ๐ช Standard Windows APIs | Only uses official Windows features |
Better Ctrl+W can only:
- โ See which window is currently active (to decide if it should close)
- โ Detect when you press Ctrl+W
- โ Send a "close window" command (same as clicking the X button)
Better Ctrl+W cannot:
- โ Read your files or documents
- โ See what you're typing (except detecting Ctrl+W)
- โ Access the internet or network
- โ Modify other programs
- โ Change Windows system settings (except its own startup entry)
- โ Run without your permission
For the security-conscious (click to expand)
Permissions Used:
- Keyboard hook (
SetWindowsHookEx) - to detect Ctrl+W - Window enumeration (
GetForegroundWindow) - to identify active window - Process access (
GetWindowThreadProcessId) - to check exclusion list - Registry write (optional) - only for "Start with Windows" feature
No Network Access:
- Does not request internet permissions
- Does not open sockets or connections
- Cannot send or receive data
Code Signing:
- Future releases will include code signing for additional verification
Open Source:
- Full source code available at https://github.com/lhunter3/BetterCtrlW
- Build it yourself if you prefer!
| Requirement | Details |
|---|---|
| Operating System | Windows 10 or Windows 11 (64-bit) |
| Disk Space | ~100 MB |
| RAM | Minimal (uses ~20-30 MB when running) |
| Processor | Any modern CPU (no special requirements) |
| Dependencies | None! Installer includes .NET runtime |
| Permissions | Standard user (admin not required) |
โ Works with all Windows 10 versions (build 1809 or later) โ Works with Windows 11 โ Compatible with multi-monitor setups โ Works alongside other keyboard automation tools โ Supports all keyboard layouts and languages
โจ Features:
- Global Ctrl+W keyboard hook for closing windows
- Smart exclusion system for browsers and code editors
- Fullscreen window detection
- System tray integration
- Auto-startup with Windows option
- Customizable JSON configuration
- Inno Setup installer
If Better Ctrl+W makes your life easier, consider:
- โญ Star this repo on GitHub
- ๐ Report bugs or suggest features via GitHub Issues
- ๐ข Share it with friends and colleagues
- ๐ง Contribute code improvements or translations
Every bit helps make Better Ctrl+W better for everyone!
Prerequisites:
- .NET 8.0 SDK
- Windows 10/11
- Inno Setup 6.0+ (for creating installer)
Quick Build:
# Clone the repository
git clone https://github.com/lhunter3/BetterCtrlW.git
cd BetterCtrlW
# Build and run
dotnet build
dotnet runCreate distributable installer:
# Build single-file executable
dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true
# Create installer (requires Inno Setup installed)
.\build-installer.ps1Output: Output\BetterCtrlW-Setup.exe
See BUILD.md for detailed build instructions.
- Keyboard Hook: Uses Windows low-level keyboard hooks (
SetWindowsHookExWin32 API) to intercept Ctrl+W globally - Fullscreen Detection: Compares window dimensions to monitor dimensions using
GetWindowRectandGetMonitorInfo - Process Detection: Gets the active window's process name via
GetForegroundWindowand checks against the exclusion list - Window Closing: Sends
WM_CLOSEmessage to gracefully close the window
Decision Flow:
Ctrl+W pressed โ Is fullscreen? โ Yes โ Ignore
โ No
Is excluded? โ Yes โ Pass through
โ No
Send WM_CLOSE
Program.cs- Main entry point and system tray setupKeyboardHook.cs- Global keyboard hook and window closing logicWin32.cs- Win32 API declarations (P/Invoke)AppConfig.cs- Configuration file managementStartupManager.cs- Windows Registry auto-startup managementConfig.json- User configuration (exclusion list, settings)installer.iss- Inno Setup installer scriptbuild-installer.ps1- Build automation script
Contributions are welcome! Please feel free to:
- Report bugs or issues
- Suggest new features
- Submit pull requests
MIT License - see LICENSE file for details.
Found a bug or have an idea? Open an issue on GitHub!
Considering for future releases:
- ๐จ Custom tray icon
- ๐ Multiple language support
- โจ๏ธ Customizable hotkey (not just Ctrl+W)
- ๐ Usage statistics (optional, privacy-first)
- ๐ Auto-update functionality
- ๐ฏ Window-specific rules (e.g., "close Chrome windows but not tabs")
Have an idea? Suggest it here!
Made with โค๏ธ by Lucas Hunter
If Better Ctrl+W saves you time, consider giving it a โญ on GitHub!
