modeless and modal child dialogs
-
I'm creating a modal child dialog and a modeless child dialog to learn about them. I have a simple SDI application that calls the dialogs. The modal child dialog derived from CDialog opens up behind the mainframe and does not have the focus, nor is it ever able to obtain the focus once I find it, i.e. title bar remains grayed and cannot click on any buttons on the modal child dialog. Properties of the dialog are child and visible. CModalChild cmd; cmd.DoModal(); The modeless child dialog opens up as it should but does not have the focus nor is it ever able to obtain the focus, i.e. the title bar remains greyed although the modeless child dialog is functional. if (!m_pModelessChildDialog) m_pModelessChildDialog= new CModelessChild; if (!::IsWindow(m_pModelessChildDialog->GetSafeHwnd())) m_pModelessChildDialog->Create(IDD_DIALOG6, this); m_pModelessChildDialog->ShowWindow(SW_SHOW); Hope someone can help me understand this. Thanks.
-
I'm creating a modal child dialog and a modeless child dialog to learn about them. I have a simple SDI application that calls the dialogs. The modal child dialog derived from CDialog opens up behind the mainframe and does not have the focus, nor is it ever able to obtain the focus once I find it, i.e. title bar remains grayed and cannot click on any buttons on the modal child dialog. Properties of the dialog are child and visible. CModalChild cmd; cmd.DoModal(); The modeless child dialog opens up as it should but does not have the focus nor is it ever able to obtain the focus, i.e. the title bar remains greyed although the modeless child dialog is functional. if (!m_pModelessChildDialog) m_pModelessChildDialog= new CModelessChild; if (!::IsWindow(m_pModelessChildDialog->GetSafeHwnd())) m_pModelessChildDialog->Create(IDD_DIALOG6, this); m_pModelessChildDialog->ShowWindow(SW_SHOW); Hope someone can help me understand this. Thanks.
Hello. In the SDI project, you should show your dialogs after created the mainframe class. You should calling the DoModal or ShowWindow Founctions in the your view class. excuse me if my sentences are not complete. because, I don't know english well. Zo.Naderi_Iran
-
Hello. In the SDI project, you should show your dialogs after created the mainframe class. You should calling the DoModal or ShowWindow Founctions in the your view class. excuse me if my sentences are not complete. because, I don't know english well. Zo.Naderi_Iran
-
I'm creating a modal child dialog and a modeless child dialog to learn about them. I have a simple SDI application that calls the dialogs. The modal child dialog derived from CDialog opens up behind the mainframe and does not have the focus, nor is it ever able to obtain the focus once I find it, i.e. title bar remains grayed and cannot click on any buttons on the modal child dialog. Properties of the dialog are child and visible. CModalChild cmd; cmd.DoModal(); The modeless child dialog opens up as it should but does not have the focus nor is it ever able to obtain the focus, i.e. the title bar remains greyed although the modeless child dialog is functional. if (!m_pModelessChildDialog) m_pModelessChildDialog= new CModelessChild; if (!::IsWindow(m_pModelessChildDialog->GetSafeHwnd())) m_pModelessChildDialog->Create(IDD_DIALOG6, this); m_pModelessChildDialog->ShowWindow(SW_SHOW); Hope someone can help me understand this. Thanks.
I think, even though u r calling DoModal() on modal dialog box, the main focus is present on the view and mainframe and the Menu is grayed may be because you may have attached the menu to the dialog box instead to the main window. Try attaching the menu to the main frame window. Work hard and bit of luck is KEY to SUCCESS.
-
I think, even though u r calling DoModal() on modal dialog box, the main focus is present on the view and mainframe and the Menu is grayed may be because you may have attached the menu to the dialog box instead to the main window. Try attaching the menu to the main frame window. Work hard and bit of luck is KEY to SUCCESS.