Hi, I have created a dialog window called window1, this is the base one. And in that on Button action event I have created one more dialog window called window2. Now I returned to window1. On the wiondow1 whenever I click on the closing X mark on the right top corner of the window it should ask me "Do u want to exit message with Yes or no Button? I did that with AfxMessageBox("Do....",MB_YESNO,0); When I select no the window1 should not terminate. But it is terminating. how to do this? Help me. Regards AshokKumar.G
Hi.........AshokKumar.G Override OnCancel method for window1 and copy line if(IDYES == AfxMessageBox("Exit",MB_YESNO,0)) CDialog::OnCancel(); Note :: IDABORT The Abort button was selected. IDCANCEL The Cancel button was selected. IDIGNORE The Ignore button was selected. IDNO The No button was selected. IDOK The OK button was selected. IDRETRY The Retry button was selected. IDYES The Yes button was selected. Enjoy ..Buddy..................... Regards Jadav Rakesh C. VC++ Developer