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!

MDI Window leaving trail on close

Status
Not open for further replies.

kindredbot

Programmer
Dec 20, 2004
4
US
I am writing a program that is an MDI Application. If I have multiple document windows open and then close them, they will all disappear like I want them to until I get to the last one. When I close the last one, it looks like it is minimizing to the lower left hand corner of the window, and then disappears. I'd like it to just disappear like the other document windows do. This seems to only happen when closing a window that is the only one visible. Can someone tell me why this is happening and maybe how to fix it? TIA
 
Are you using MFC or another class library or C#?

I've done this with native Windows calls and never had one behave like you describe.
 
That's the problem with using wrapper classes... you're stuck with someone else's concept of how a certain component should behave. They're probably proud that they made the window minimize before closing...

Have you tried adding an empty onClose to the MDIChild class?

Have you also tried having two windows open and Tiled and closing the left one first to see if the other windows are doing this too and it's just hidden behind the other open windows?

I'm just puzzled why they'd write special case code for closing the last MDI child...
 
I found what the issue was, thank you for your help with it.
 
Sorry, it was actually an error with my code, and not in the functions of an MDI winow at all. When I commented out a line of my code, it worked like I wanted it to. I guess the problem I discovered is that when the window is closed, the focus is changed to another window before the window is actually closed, which makes sense to me now that I have thought about it. There was code to minimize all open windows if a background window gains focus, so when the last window was closed, the focus shifted to the background window, which in it's OnFocus function minimized all open windows, which caused the issue. Thanks for pointing me in the right directoin of where to look.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top