响应主框架的WM_CLOSE 消息 void CMainFrame::OnClose() { if( MessageBox("are you sure want to quit?", "", MB_OKCANCEL) != IDOK ) return; CFrameWnd::OnClose(); }