An attempt to set the “Do you want to save” dialog when trying to close the window using the close button in the thumbnail of the taskbar in Windows 7 (with the aero peek function active).
Using MessageBox () while processing WM_CLOSE does not work. MessageBox will not be displayed until you click on the thumbnail, so aero peek is disabled.
Many applications have this erroneous behavior, so this is probably a design flaw in Windows 7, but it works for some programs (Word, Notepad, Visual Studio, ...), so I wonder what trick they use (or what required to "exit" from aero peek-mode).
The small Sound Recorder application shipped with Windows 7 has the same problem (if you recorded something without saving and try to close it using the thumbnail button) ...
source
share