Change Shortcut for closing windows

Solution 1:

  1. Download and install AutoHotkey
  2. Create an empty file called shortcuts.ahk
  3. Create a shortcut to that file and put it in the Startup folder
  4. Edit shortcuts.ahk and put this in it:

    ^w::Send ^{F4}

  5. Double click on shortcuts.ahk

Keep in mind that Ctrl+W is used for other things, e.g. in Notepad², it enables word wrap.

See also:

  • Is there a way to create a custom hotkey in Windows that will close the current window or sub-window?
  • Better Windows Shortcuts blog post
  • all my AutoHotkey settings (for ideas, e.g. Ctrl + Q)

Solution 2:

I think that even an AutoHotkey beginner can do this. The script is as follows:

Alt & F4::
    return
Ctrl & w::
    WinClose, A

But what if you just wanted to close a Word document or a Firefox tab (when Ctrl+W is used as a hotkey), not the whole application?