Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modeless Dialogs in Doc/View MFC application

Status
Not open for further replies.

base2

Programmer
Apr 18, 2002
7
US
My Doc/View, MFC application creates several modeless dialogs (Text file browsers, PropertySheets, etc.). While they are on screen, I can click the title bar of the main view window and input focus will be transferred to the main view window of the application. However, the main view does not 'overlay' the dialog window in the regions shared by both windows and therefore, part of the window that now has focus is obfuscated by the modeless dialog window that no longer has focus. I have tried every combination of settings I can think of in the main window and the dialogs (clipchildren, etc.).

Q: Is this the only way this can work by design or is there some combination of settings I have missed? Or do I have to write an additional handler somewhere? Can anyone point me at an example somewhere, all the MS-provided examples I have found thusfar function the same way.

Sorry if this is a rather remedial question and any assistance will be much appreciated.
 
I dont know if I understood the question you had correctly.
But a simple suggestion i have is to call the member function "ShowWindow(SW_HIDE);", which will hide the window, and to get it again: "ShowWindow(SW_SHOW);"
like this:
CMyDialog dialog;

dialog.ShowWindow(SW_HIDE);

But I dont know if it is that, you wanted to know?
 
Thanks for the suggestion. I do not want to completely hide the modeless dialog when the primary view receives focus, I just want the primary view to sit 'on top' of the modeless dialog when this happens. As it works now, the primary view receives focus but the dialog still has a region that 'overlaps' the primary view. I wan the primary view to 'overlap' the dialog in the region shared by the two windows.
 
The solution to this is:
when you create the modeless dialog, use the desktopwindow instead of your frame window as its parent window.

Create(IDD,CWnd::GetDesktopWindow());
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top