处理SC_CLOSE, WM_CLOSE message
void CMainFrame::OnClose() 
{
// TODO: Add your message handler code here and/or call default
if(IDYES==AfxMessageBox("alt f4 in OnClose--WM_CLOSE", MB_YESNO|MB_ICONSTOP))
;
else
return;
CMDIFrameWnd::OnClose();
}void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) 
{
// TODO: Add your message handler code here and/or call default
bool bClose=false;
if(nID==SC_CLOSE)
{
if(IDYES==AfxMessageBox("alt f4 in OnSysCommand--WM_CLOSE", MB_YESNO|MB_ICONSTOP))
bClose = true;
else
return;
}
CMDIFrameWnd::OnSysCommand(nID, lParam);
}