How can i check that button is clicked in no modal dialog
I created main dialog and call no modal dialog, how can i check in main dialog that button is clicked in no modal?
For example if i call modal i can开发者_如何学运维 check like this:
Dialog Dlg;
int DlgResult = static_cast<int>(Dlg.DoModal());
if (DlgResult== IDOK)
{
//do smth.
}
If its a custom dialog, one way would be to use SendMessage()
or PostMessage()
to send the result to the main dialog when the non-modal dialog closes.
Even after the window closes, you will still have access to the C++ object representing the dialog. You can override OnOK and OnCancel and have them save a flag in the object.
精彩评论