16,472
社区成员
发帖
与我相关
我的任务
分享
void CPopupMenuView::OnPopupmenuExit()
{
// TODO: Add your command handler code here
if(IDYES == MessageBox(L"Are you sure you will exit?", L"Exit Tip", MB_ICONQUESTION | MB_YESNO))
{
GetParent()->DestroyWindow();
PostQuitMessage(0);
}
}
void CPopupMenuView::OnPopupmenuExit()
{
// TODO: Add your command handler code here
if(IDYES == MessageBox(L"Are you sure you will exit?", L"Exit Tip", MB_ICONQUESTION | MB_YESNO))
{
DestroyWindow(); //这样可以退出程序,但是和发给框架类有区别吗?
PostQuitMessage(0);
}
}
exit(0);
//在视类中添加的处理代码
::SendMessage(GetParent()->m_hWnd, WM_CLOSE, 0, 0);