NoClose: Disable the Close Button on Chosen Windows with AutoHotkey

You’ve got a program that has to stay open. Then someone clicks the X.

Maybe it was a coworker. Maybe it was you, aiming for the window behind it.

How about you? Is there a window you’d love to protect from a stray click?

NoClose disables the Close button (X) on the windows you pick. One hotkey turns it off, another turns it back on. 😊

Video: prevent users, and yourself, from closing a program
Watch it in action on YouTube

Hotkeys That Turn the X Off and On


Click into the window you want to protect and press the hotkey. NoClose removes Close from that window’s system menu, so the X stops working.

The AutoHotkey v2 version uses these defaults:

  • Ctrl+1: disable the Close button on the active window
  • Ctrl+Shift+1: turn it back on
  • Alt+1: disable it and add the window to the AutoDisable list
  • Alt+Shift+1: enable it and add the window to the Exclusions list

Want different keys? Open Settings from the tray menu and change any of them.

Rules That Run in the Background


Windows on the AutoDisable list get their X turned off whenever they’re open. The v2 version checks for them every quarter second.

The Settings window has tabs for both lists, so you can see your rules and delete the ones you don’t need.

Click Add on either tab, then click any window to put it on that list.

On an older setup? The original v1 version, by Skrommel of 1 Hour Software, uses Ctrl+1 to toggle the X and Ctrl+2 to add a rule.

It can apply your rules when NoClose starts and when new windows open, then turn the X back on when NoClose exits.

What’s in the Download


  • V2 folder: a ready-to-run NoClose.exe (version 1.1.0) plus the AutoHotkey v2 source
  • V1 folder: the original NoClose.ahk and a ready-to-run NoClose.exe
Requirements: Windows. Each exe runs on its own.

To run the v2 script instead, you need AutoHotkey v2. It saves your hotkeys and lists to Settings.ini in its own folder.

Get NoClose


NoClose is $4.99. You get both the v1 and v2 versions.

One thing I’ve learned: the most expensive click is the one you didn’t mean to make.

Take that click off the table. ⚡

Joe

Comments are closed.