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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I do for asking if You are sure to close the program ?

Status
Not open for further replies.

youssef

Programmer
Mar 13, 2001
96
BE
Hi,

I would like before to close the programme to ask with a message Box Are you sure Yes of No ?

If No button is pressed Continue the program otherwise close.

Best Regards
 
You can put your message box code on WM_CLOSE message handler or create a message handler for you exit Button and write it on there.

For example:
Code:
void Test::OnClose() 
{
	
if(MessageBox("Are you sure to exit:Yes or No ",NULL,MB_YESNO) == IDYES)
    CDialog::OnClose();
	
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top