Jump to content
  • Advertisement
Sign in to follow this  
Zoomby

modeless dialog in modal dialog?

This topic is 4494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Yes, why not do something like:


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).

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Quote:
Original post by Taha Ansari
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


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.

Share this post


Link to post
Share on other sites
yadango is right. I just used a modeless dialog as parent dialog and made it "modal" with EnableWindow(hwndMain,FALSE)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!