My app is dialog based. The main dialog is essentially a web browser. It has
menu items that open other modeless dialogs. (One shows the page source, one
shows the current search path set.) The problem that I am having is that the
child dialogs (source and paths view) always hide the parent. They do not
hide each other. (i.e. the active one always comes to the top of the display
The main dialog is run modeless (using Create), and has its parent window
pointer set to NULL.
I can activate the main dialog, but it remains hidden behind the others if
they are on the screen. What I want is to be able to activate any of the
three windows and have it displayed in front of the others.
I have tried the following:
1) Setting m_pMainWnd to NULL in the app's InitInstance method. This just
causes the app to close immediately after it starts.
2) Runing the main dialog using DoModal, rather than Create. This changed
nothing. (The modeless child dialogs were created and could be activated.
Somehow, I thought this wouldn't work if their parent was a modal dialog. It
seems to violate the "modal-ness" of the parent. That's why I made the main
dialog be modeless to begin with.)
3) Having the child dialogs pass a NULL pParent pointer to the CDialog
constructor. This changed nothing.
I have also edited the resource file using the text editor and made sure
that the dialogs are created with the same styles. This changed nothing.
How can this be done? I have considered making an invisible modeless dialog
that is the main window for the app, then running all of mine as children of
that one, but it seems like a rather roundabout approach. Is there something
simple that I have missed?