Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
3  
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
add comment

2 Answers

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.

http://www.donationcoder.com/Software/Skrommel/index.html#NoClose

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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