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:
void Test::OnClose()
{
if(MessageBox("Are you sure to exit:Yes or No ",NULL,MB_YESNO) == IDYES)
CDialog::OnClose();
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.