Hi.
Working with pure Win32 API here; I'm trying to create the following scenario:
- From main window (or a dialog), call int result=DialogBox(...)
- The user sets his stuff in the dialog.
- User presses OK, so EndDialog(hwnd,IDC_OK);
- Back in the main window, switch(result) tells me that the dialog ended with IDC_OK. Now, I want to be able to process the data the user entered in the dialog. GetDlgItemText() or similar functions wouldn't work, as the dialog has already closed, and also because I can't get the dialog's hwnd.
I prefer not to process the data from the dialog's procedure, since it would make things harder and messier. Is there any way to do this?
Thank you.
Again, same concept. The Dialog would just set all the data in the appropriate MyDialog object so it can be retrieved after the dialog has closed.
You might notice that this is essentially what common dialogs do. For instance the GetOpenFileName function fills the provided OPENFILENAME structure with data taken from the dialog.