Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Windows 7, I use an application which I sometimes close by accident. Is there a way to make Windows issue a "Do you really want to do this" warning when I try to close the application? (It's just a normal Windows application which I usually close by clicking the cross in the upper right corner of the window.)

share|improve this question
This can only be handled by the program's author. – Ramhound Jan 7 '13 at 18:27
In my experience programs prompt me if something is unsaved, and that is always my biggest worry. – Guy Thomas Jan 7 '13 at 18:38
up vote 1 down vote accepted

I don't think you can do it directly using windows, but you could use this small donation ware program to turn off the Close button on windows.

You can still close the program using the File>Exit option if it has one and you would need to add it to your start up to work all the time.

share|improve this answer

When you click the close button on a normal window, the operating system sends a "window message" to the process that owns that window; for example, WM_CLOSE (technical info here).

Windows provides a built-in API (part of the Win32 API) which you can use to intercept window messages sent to other windows, even out-of-process. So you could write an external application that does this.

See SetWindowsHookEx routine.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .