Solved

Application Close button

Posted on 1998-10-09
3
357 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
Host to IP 7 80
Expand macro to ask for filename column 8 37
only14 challenge 19 81
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

791 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