modeless dialog in modal dialog?
Hi,
how can I create a modeless child dialog in a modal dialog? The main message pump is bypassed, so I can't use "IsDialogMessage". How to do it?
Bye,
Chris
All I can think of would be create a seperate thread to create the dialog, and pump messages in that.
Yes, why not do something like:
So that pDlg2 will be a modal less dialog; this function was called from a modal dialog. I had no problem with the same ( VC 6.0/ MFC Dlg based app).
CDlg2 *pDlg2 = new CDlg2();pDlg2->Create( IDD_DIALOG2, NULL);pDlg2->SetFocus();pDlg2->ShowWindow( SW_SHOW );
So that pDlg2 will be a modal less dialog; this function was called from a modal dialog. I had no problem with the same ( VC 6.0/ MFC Dlg based app).
If you're using MFC you don't need to do anything extra. The DoModal function of CDialog directly pumps all the threads messages.
Quote:Original post by Endurion
If you're using MFC you don't need to do anything extra. The DoModal function of CDialog directly pumps all the threads messages.
True, but DoModal wouldn't create a modal less dialog, and the parent, say dlgParent (from where this dialog was created) will only be accessable when this dialog (say dlg1) exits; whereas in case of modal less dialog, both dlgParent and dlg1 can be accessed.
If I have lesser knowledge about DoModal, then do let me know.
Thank you
Quote:Original post by Taha AnsariQuote:Original post by Endurion
If you're using MFC you don't need to do anything extra. The DoModal function of CDialog directly pumps all the threads messages.
True, but DoModal wouldn't create a modal less dialog, and the parent, say dlgParent (from where this dialog was created) will only be accessable when this dialog (say dlg1) exits; whereas in case of modal less dialog, both dlgParent and dlg1 can be accessed.
If I have lesser knowledge about DoModal, then do let me know.
Thank you
You're correct, of course the second dialog needs to be created modeless (via the CDialog::Create function).
With DoModal i was just referring to the main dialog. I'm not sure the same would work if you'd use DialogBox (e.g. pure Win32 API) for the main dialog.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement