Solved

Application Close button

Posted on 1998-10-09
3
351 Views
Last Modified: 2013-11-20
How do I grab the signal hit when the user clicks on the close button (the X in the upper right hand corner)?

I've got a function that's called when the ID_APP_EXIT message is sent but this isn't being hit when the close button is clicked, as I'd expected. And for some reason I can't find it in the MFC Devstudion 5.0 documentation.
0
Comment
Question by:winkle
  • 2
3 Comments
 

Accepted Solution

by:
umarama earned 50 total points
ID: 1323164
In Mainframe ....
Add the following handler

ON_WM_SYSCOMMAND()

afx_msg void CMainFrame::OnSysCommand( UINT nID, LPARAM lParam )
{

   if (nID == SC_CLOSE)
   {
      // Do your processing
   }
}
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1323165
Is there any particular reason you accepted my answer and then posted another question that asked the exact same thing winkle?  If you needed help, I think I could have provided it :-)
0
 

Expert Comment

by:umarama
ID: 1323166
To thresher_shark

Me think, we both answered winkle's question at the same time !!
He liked your answer and accepted it. Winkle is probabily not aware of this answer !
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
fix34  challenge 9 96
mapBully challenge 6 88
wordcount challenge 11 74
Sed question 2 45
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now