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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modeless Child Dialog

Status
Not open for further replies.

ed9871

Programmer
Jan 15, 2002
14
0
0
US
I have created a modeless dialog in my MDI application. I want to use it when a certain long process is being run ("Please wait"). If I make it modal, the user can't do anything else until the dialog is closed and I want them to have access to the menu bar to open another document or anything else. I also need the dialog to be "attached" to the specific document window that is performing the long process. So - I create the dialog and do ShowWindow and the dialog comes up. Great so far. Here's the problem. If I make the dialog a popup, it stays on top even if a new document is opened, and it also doesn't stay with the window that called it if you move or minimize the window. So I made it a child. This keeps it with its own window, which is perfect, only now the dialog doesn't have focus (I have a cancel button on it) and the controls from the window that called it show through on the dialog. What am I doing wrong? Any help you can give me will be great.

Ed
 
If You create and show a Dialog, You should hide and close it too. I don't think, that Windows can do it automatically exactly how You wish without any work for You. So You can try to change the place/class You create the Dialog from and it's Parent (to destroy it, for example,if the parent window is no more active or to move it with the Parent). You can try to modify of Dialogs style with ModifyStyle() (there are a lot of styles!).
You can make a table for You: what should do Your Dialog in all cases: new file (hide? close/destroy? foreground? focus? enable/disable? enable/disable parent/main window? change Text?), exit, minimize, move, underground, many such dialogs, Message box from Your Program/another program, key down, mouse click if in foreground/ not in foreground, another user action, topmost window appears etc...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top