在子窗口中如何关闭主程序?
主窗口的指针保存在CWinThread::m_pMainWnd中,调用AfxGetMainWnd实现。
AfxGetMainWnd()->PostQuitMessage(0);//最常用
AfxGetMainWnd()->PostMessage(WM_QUIT); //也很好
AfxGetMainWnd()->SendMessage(WM_CLOSE); //也行的
ExitProcess(0); //也可以
在子窗口中如何关闭主程序?
主窗口的指针保存在CWinThread::m_pMainWnd中,调用AfxGetMainWnd实现。
AfxGetMainWnd()->PostQuitMessage(0);//最常用
AfxGetMainWnd()->PostMessage(WM_QUIT); //也很好
AfxGetMainWnd()->SendMessage(WM_CLOSE); //也行的
ExitProcess(0); //也可以
暂无评论