I'm looking for a feature that will close the window by middle-clicking the window's title. It would be nice if I could do that in Windows 7.


You could use AutoHotkey. Several years ago, “evl” posted a script that does exactly what you want:

Middle click sends a normal middle click unless:

  • Over the taskbar: Closes the window whose button is under the mouse (aborts if window prompts to save,etc).

  • Over the titlebar of a window: closes the window (can be made more sensitive to specific window areas - see Shimanov's post: http://www.autohotkey.com/forum/viewtopic.php?t=8486).

  • Over an internet explorer class window: Opens a link in a new window (keep holding the button down to switch back to the original window).

You can run it as a script or compile it to be run as a background program.

  • I've just tested with my Windows 7 that doing so is to clone the application window as a native feature. It would be nice to add Ctrl key to the script - but I don't know how to change it. Please help – Nam G VU Aug 2 '12 at 5:13
  • Clone? It works fine for me, so I’m not sure what the problem is. It is written so that it closes a window when you middle-click its taskbar button or its titlebar, and the only other thing is for IE windows; it opens their links in a new window. Is that where you are seeing the “cloning”? In IE or every window? For example, does happen with Notepad? – Synetech Aug 2 '12 at 14:46
  • You can cut out the IE code by removing the block starting with ; Open IE link in new window as well as the block starting with OpenIELinkInNewWindowSleep:. Also, you can make it only work when Ctrl is held down by changing the first line from MButton:: to ^MButton::. – Synetech Aug 2 '12 at 14:49
  • My apologise. I did a mistake; instead of testing on a windows, I test on the taskbar. So please ignore my comment. Sorry again! – Nam G VU Aug 3 '12 at 10:18
  • I've checked your answer as accepted - but autohotkey has a trojan as scanned by virustotal.com virustotal.com/file/… – Nam G VU Aug 3 '12 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.