Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firing an event when closing out an application

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How could I make my program do something when if I use the close button (little x in the upper right hand corner)? I guess what I'm asking is how you capture it. Any and all information would be greatly appreciated. Thanks in advance.

Niky Williams
NTS Marketing
 
Hello Niky,

Do the following. You must override OnDestroy(). If your dialog class was called CDialogAllDlg it would look like this...

void CDialogAllDlg::OnDestroy()
{
CDialog::OnDestroy();
AfxMessageBox("Window Destroyed");

}

Class wizard can help you out with this.

Brother C
 
Oh wonderful, that's easy...thank you so much!

Niky Williams
NTS Marketing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top