Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
| Search | Today's Posts | Mark Forums Read
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2013, 09:15 PM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default How can I manage the cancel button?

Hi, I'm trying to manage the cancel button. Could somebody help me?. When I push the "X" (left-top of window) I want to save before ending the application.
Thanks.
 
Old July 29th, 2013, 12:51 AM
mbatra
Guest
 
Posts: n/a
Default

Hi,

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.



Regards,
Mbatra
The Following User Says Thank You to For This Useful Post:
AGonzales (July 29th, 2013)
 
Old July 29th, 2013, 11:05 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mbatra View Post
Hi,

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.



Regards,
Mbatra
Thanks Mbatra.
I tried your advice. It's really correct.
Now my program is working.
Thanks very much.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Paramater value cancel button errors REVNED VB How-To 1 September 2nd, 2008 01:23 PM
DetailsView Cancel button to redirect firblazer ASP.NET 3.5 Basics 4 June 23rd, 2008 01:23 AM
How to stop file uploading when a cancel button coolcoder2007 ASP.NET 2.0 Basics 0 October 26th, 2007 04:21 AM
How can I cancel deleting ? ALGNET ADO.NET 1 March 22nd, 2006 01:55 PM
Problem with cancel and next button in form method Access VBA 0 June 18th, 2005 02:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.