BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) { TRACE("\n MSG %d", pMsg->message); if(pMsg->message == WM_CLOSE) MessageBox("WM_CLOSE"); else if(pMsg->message == WM_QUIT) MessageBox("WM_QUIT"); else if(pMsg->message == WM_DESTROY ) MessageBox("WM_DESTROY"); return __super::PreTranslateMessage(pMsg); // allow default behavior }
void YourClass::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == SC_CLOSE) { } }
ON_WM_CLOSE()
CMainFrame
afx_msg void OnClose();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)