Originally Posted by mbatra
you can add "OnSysCommand()" to your application dialog class. Then check for "SC_CLOSE" condition and do whatever you want in that. You can provide a message for saving the application to the user.
I tried your advice. It's really correct.
Now my program is working.
Thanks very much.