views:

50

answers:

2

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.
}
+1  A: 

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.

Georg Fritzsche
+1  A: 

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.

Mark Ransom
if don't want close window? I need something like windows notepad search enter word -> press the button -> underline found string => window doesn't closed
Sergey