Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How to generate a System Event when a program hangs

07 Jan 2016   #1

How to generate a System Event when a program hangs

Greetings all -

Win7/64Pro Question

I am looking for a short term solution for automatic intervention. Longer term is to address the stability issue within a specific custom application.

There is a two computer setup, where a custom interactive application lives on each PC, and interacts through a asynchronous server application installed on one of the two PC's. A particular application installed in a kiosk with touch screen, occasionally hangs. The visual results are the on screen animation stops, yet everything all continues to work between both PC's.

Without interacting with the application, I can bring up the Task Manager, and see the the application is not responding from the [Applications] tab. I can also see the application is not responding from the [CPU] tab of the resource monitor.

Once I touch / interact with the hung application, I get a dialog box, asking me to either close the app or wait longer for it to respond. When you select close, the application closes, and an EVENT is generated. I currently use this EVENT [Application / "Application Hang" / ID:1002] to trigger a reboot scripts for both machines. This process still requires the manual action of someone pressing the close button on the hung process. I would like the reboot sequence to happen automatically, once the application hangs.

Finally... My Question:
1. Is there a way to generate an EVENT (that I can trigger on) when an application hangs or is not responding. I am currently looking through the local group policy editor, but have yet to find anything.

2. If I can generate an EVENT from a hung application (as in Q1), can I specify which application to monitor for such a state?

Thank in advance

My System SpecsSystem Spec
07 Jan 2016   #2

Windows 7 Pro 64 bit

I don't believe that Windows does anything like what you want. It simply isn't practical to do so. The criteria that Task Manager uses to indicate a non responding process is really very simple. Basically all it means is that an application has not responded to messages over a 5 second period. There are 1001 reasons why an application my be in such a state, some indicating a problem within the application, some not. Many applications will do this at times and be operating exactly as designed. It requires human judgment to determine whether Task Managers display is telling us of a problem or simply an unusual occurrence.
My System SpecsSystem Spec
07 Jan 2016   #3


Thanks for the feedback.

In this case, its a specific application/Process that will remain in the "Not Responding" state indefinitely, until someone interacts with it, prompting the OS to display the dialog box, offering either WAIT or CLOSE options. I want to initiate a reboot script before this point.

Based on a suggestion from someone in my office, I may be able to achieve my goal with [TASKKILL].

I would run a script in a loop (maybe every 30 seconds), that tests for the condition, and kills the process if the condition is met. This should generate the required EVENT, from which I can trigger a specific reboot script. I am currently waiting for the app to fail, to test this suggestion.

This is the TASKKILL command line.

TASKKILL /F /IM "IMAGENAME eq ApplicationName.exe" /FI "STAUS eq Not Responding" /T

I will advise if this works.

Kind Regards
My System SpecsSystem Spec


 How to generate a System Event when a program hangs

Thread Tools

Similar help and support threads
Thread Forum
Frequent system hangs, "atapi Event ID 11" in Event Viewer
Hi, I recently made some upgrades to a (previously fine) PC - they were - Installing 4GB extra RAM, of the same variety - Reinstalling windows on a new SSD (a Samsung SSD 850 EVO 500GB) I previously also upgraded to Windows 10, but a bunch of blue screens and other issues later I reinstalled...
System hangs - Event log showing AHCIX86S ID 129
I'm getting system hangs and no response, usually in the morning (I leave the system running 24/7). I see in the event viewer "Reset to device, \Device\RaidPort0, was issued". I'm running W7 32bit, with an AMD raid 1 and a secondary drive. The AMD Raid tool shows everything is functioning...
General Discussion
Generate a system health report does not work
OK, lets see if we can get this one to work next :) Seems to be quite common out there. I run the application and get the little timer saying its working for 60 seconds then it fails and gives the error message:
Performance & Maintenance
Generate system health report error?
Hi,Just ran this test and i get an error on "hardware device and drivers check". Is this something to worry about?laptop seems to be running fine. Thanks in advance for any help.
Performance & Maintenance
Can't Generate System Health Report
When I generate a system health report, this is just what it shows, even if I ran a sfc /scannow it still can't be fixed. What should I do?
Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:04.
Twitter Facebook Google+