Hi everyone,
there is something that I'm not very clear about. Why do my program close when I click the cross button on the top right hand corner where I had comment the on PostMessage for the following code below? And also, why when I Post WM_DESTORY, my dialog did not close?
Code:
void CMYDlg::OnClose()
{
int returnValue=IDNO;
retValue = ::MessageBox(NULL, _T("You are about to close the application, are you sure you want to continue?"),
_T("Testing"), MB_YESNO|MB_ICONQUESTION);
if(returnValue == IDYES)
{
::PostMessage(0,WM_DESTROY,NULL,NULL);
}
CDialog::OnClose();
}