For example, click the menu Popup Non-modal dialog box .
Step1
Resource View Add dialog box template . Renaming a dialog box resource ID.
Step2
Check the dialog box , Right-click menu to add Class .
Step3
In the message handling function of the menu item
Cdialogaddcontactdlg;
INT_PTR Nresponse =dlg. DoModal ();
if (Nresponse ==idok)
{
}
else if (nresponse== IDCANCEL)
{
}
can be domodel Create modal dialog box through create Create modeless dialog box Explains the two types of dialog boxes dialog boxes is of both Types:modal andmodeless. A modal dialog box must is closed by the user before the applicationcontinues. A modeless dialog box allows the user to display the dialog box Andreturn to another task without canceling or removing th E dialog box.
How to close a dialog box ? Remarks is described below .
A modal dialog boxcloses automatically when the user presses the OK or Cancel buttons or Whenyour code calls the EndDialog member function.
When you implement Amodeless dialog box, always override the OnCancel member function and Calldestroywindow from within it . Don ' t call the base class Cdialog::oncancel,because it calls EndDialog, which'll make the dialog box invisible but Willn OT destroy it. should also override PostNcDestroy for modeless dialogboxes in order to delete this, since modeless dialog boxes is U Suallyallocated with new. Modal dialog boxes is usually constructed on the frame Anddo not need PostNcDestroy cleanup.
Https://msdn.microsoft.com/en-us/library/132s802t.aspx
Re-explore MFC (IV) Create dialog box