Programming/MFC
MFC Dialog Modal
TanSanC
2016. 9. 22. 16:48
부모 Dialog 에서
자식 Dialog를 Domodal로 부른 뒤
void CMyDialog::OnMenuShowSimpleModal() { CSimpleDlg myDlg; INT_PTR nRet = myDlg.DoModal(); if (nRet == IDOK || nRet == 5) AfxMessageBox(_T("Dialog closed successfully")); }
자식 Dialog가 종료 될때
void CSimpleDlg::OnRButtonUp(UINT nFlags, CPoint point) { UNREFERENCED_PARAMETER(nFlags); // Do something int nRet = point.x; // Just any value would do! EndDialog(nRet); // This value is returned by DoModal! // Do something return; // Dialog closed and DoModal returns only here! }