How to generate a System Event when a program hangs


  1. Posts : 2
    Win7P/64
       #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
    Andy
    Last edited by Andy2; 07 Jan 2016 at 10:02.
      My Computer


  2. Posts : 2,497
    Windows 7 Pro 64 bit
       #2

    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 Computer


  3. Posts : 2
    Win7P/64
    Thread Starter
       #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
    Andy
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 07:30.
Find Us