Application dies, but not in loop

D

Dave

I have created a large MDI app that just stops working at random times,
often when focus leaves the app, then comes back, but it can happen anytime.
The Main form is still there and everything, when it is in this state, but
the main form's title bar and the mdi child form's titile bar are grayed
out. You can't close the app using the buttons; I have to go kill the
process to get it to close. I thought it was in a loop, but when I hit pause
in Visual Studio while debugging, I can see that the app is just sitting
there asleep (Visual Studio shows the "Application.Run(new form());" line in
Main() as the current line), and the processor/memory is not going crazy.
Has anyone seen this kind of freeze. The only thing I can do when my app is
in this state is double-click the title bar of the main form, which switches
the app from maximized to restore and back.
 
D

Dave

Got it.

I just realized that there is a spare window that is only visible when
switching programs using alt-tab. When you alt-tab between apps, the name of
the mystery window is WindowsFormsParkingWindow. So I did a search on Google
and found an article that tells how to fix it: WindowsFormsParkingWindow
a.k.a The devil at
http://dotnet.org.za/johannds/archive/2004/03/08/650.aspx. It has to do with
focus remaining on a control when the panel is cleared using panel.clear().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top