Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

"Not Responding" Message in Windows Form Applicati

When there is a statement in a windows form application which is executing in an infinite loop, the name of the form will show "Not Responding". How does .NET determine if the application is in an unstable state? I wonder if WMI is the right way to track the application? If so, what is the right way to start? If not, is there a way to determine the
unstable state of an application?

Welcome any advice

Friday, April 29, 2005

Actually, it is Windows that determines your app is "not responding" - it has nothing to do with the fact that it is .NET

I think the way the OS decides this is by looking at the last time your application did a GetMessage / PeekMessage to handle its input message queue.  If it has been too many seconds, then it's "asleep"

A pretty good way to guess, by the way.  Although it would be even better if the OS had some signaling mechanism - communicating with the application - to query "Are you alive"?  Too bad we have so much Win16 architectural legacy.

Friday, April 29, 2005

Firefan is correct. In order for Windows to think your application is still alive, it must either call System.Windows.Forms.Application.DoEvents() periodically, or else simply idle about (waiting for Windows to call one of your main form methods).

Chris Nahr
Friday, April 29, 2005

Has anyone tried this before. I am looking for some .NET code where when you download file usuallua  wndow pops up asking you teh location wher you want to download. but in my situation I want to download teh file to a specific location rather than teh window popping up. Has any doen this before. any help will be greatly apprecaited. TIA

Friday, April 29, 2005

i believe the following url can respond to my problem and like to share....

Monday, May 2, 2005

Isn't that what I said in your other post called: "monitor processes with WMI in .NET "?

As I stated there, the System.Process class is all you need. There is no need for WMI or other fancy tricks.

Tuesday, May 3, 2005

*  Recent Topics

*  Fog Creek Home