Apr 20, 2002 #1 youssef Programmer Joined Mar 13, 2001 Messages 96 Location 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
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
Apr 21, 2002 #2 RAzizi Programmer Joined Apr 20, 2002 Messages 1 Location CZ 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(); } Upvote 0 Downvote
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(); }