Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way in windows to know if a process is not responding?

Is there a way to know when a process is hung? is there a win32 call for this?

like image 729
asmw Avatar asked Feb 09 '10 05:02

asmw


People also ask

How does Windows know when a program is not responding?

The Answer An application gets events from a queue provided by Windows. If the application does not poll the event queue for a while (5 seconds), such as doing a long calculation for example, then Windows assumes that the application is hung and alerts the user.

Which tool allows you to find the reason why an application is not responding?

To solve this problem, you might need to run System File Checker, run a performance diagnostic tool, scan your system for malware, reinstall a program, update Windows, perform a clean boot, or run the DISM tool. This guide shows how to apply these methods to resolve "The application is not responding" notification.


2 Answers

You send it a WM_NULL with SendMessageTimeout(). If that times out after something like a second or three, it's not responding (though it might eventually, of course).

like image 146
Jerry Coffin Avatar answered Oct 20 '22 00:10

Jerry Coffin


Just for other people passing by: It might be easier to use IsHungAppWindow.

like image 44
user23127 Avatar answered Oct 20 '22 00:10

user23127