I am using Visual Studio 2013 C++ MFC. I have created a mainframe and a main dialog. If I open a new smaller dialog and call a messagebox from a button within this dialog, the dialog disappers behind the main dialog. How can I avoid this? I want the dialog to stay on foreground. I appreciate your answers.
Asked
Active
Viewed 682 times
0
-
2use `DoModal();` to make modal dialog. – Himanshu Sep 08 '15 at 11:48
-
[Window Features: Owned Windows](https://msdn.microsoft.com/en-us/library/windows/desktop/ms632599.aspx#owned_windows). – IInspectable Sep 08 '15 at 12:47
-
Doesn't work! It's an MDI application and the tab-dialog (CPropertyPage/CPropertySheet) disappears behind the mainframe window if I call a messagebox from the dialog. – somula Sep 09 '15 at 08:25
-
@somula: Can you get one handle of the newly created dialog what you need to show at top level screen? – hypheni Sep 09 '15 at 10:14
-
I can create one handle (or access the dialog's member m_hwnd) - but how can I show the dialog always on foreground / top level? – somula Sep 09 '15 at 11:50
-
@ somula Take a look at http://stackoverflow.com/questions/593403/always-in-front-dialogs – pistachiobk Sep 09 '15 at 14:54
-
Thanks for the advice, but it doesn't work. It may work on dialog based application, but it doesn't work with my MDI. The dialog always gets hidden behind the mainframe. – somula Sep 10 '15 at 05:29