16,473
社区成员
发帖
与我相关
我的任务
分享
CAboutDlg* pDlg = NULL;
#define MSG_EXIT (WM_USER + 0x11)
void CGSDlg::OnOK()
{
// TODO: Add extra validation here
if(NULL == pDlg)
{
pDlg = new CAboutDlg;
pDlg->Create(IDD_ABOUTBOX, this);
}
pDlg->ShowWindow(SW_SHOW);
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
if(MSG_EXIT == msg.message)
{
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
AfxMessageBox(_T("OK"));
}
void CAboutDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
//CDialog::OnClose();
GetParent()->PostMessage(MSG_EXIT, 0, 0);
DestroyWindow();
}