?
Solved

Detecting if an application is hung

Posted on 2000-05-02
10
Medium Priority
?
317 Views
Last Modified: 2010-04-04
I want one application to detect if another application is hung. I think I need to use SendMessageTimeout.

Question: what handle should I use - the application handle with FindWindow('TApplication', 'ApplicationTitle')  or FindWindow('TFormClass', 'FormTitle')

0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 4

Expert Comment

by:mhervais
ID: 2772089
listening
0
 
LVL 20

Accepted Solution

by:
Madshi earned 200 total points
ID: 2772368
It doesn't matter which window you're using, cause if the main thread is hanging, the message loop simply doesn't process and that means that *no* window will respond.
You can't make anything wrong though, if you always use the window that is shown in the taskbar.

Regards, Madshi.
0
 
LVL 3

Expert Comment

by:smurff
ID: 2772726
listening
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:mullet_attack
ID: 2772905
You don't say if you have the source to the app you want to monitor. If you do then...

If I needed to detect if an application was hung using a special monitor program, I would make the app periodically send a message to the monitor, and the monitor would send a message back acknowledging. That way if the main app hung, the monitor would not get messages and could take action. Also, the main app would know if the monitor had hung.

If not, then hard to detect if an app has hung. It may appear to be hung from user perspective, but most times it isn't dead, it's just off doing something with the fairies. The message loop may still work, as evident in 98 or NT when you selected 'end task', sometimes the app will do a 'proper' shutdown.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2774682
it can be done I'm sure.. even unhung it sometimes.. Norton Utilities 3 has a program to do so..
0
 

Expert Comment

by:penich
ID: 2775871
Well
See At the Next Function
FindWindow
What is the Window in DELPHI
it is class
Theeeen
Obviously
You must use
FindWindow('TFormClass', 'FormTitle')
By




0
 

Expert Comment

by:penich
ID: 2775877
Well
See At the Next Function
FindWindow
What is the Window in DELPHI
it is class
Theeeen
Obviously
You must use
FindWindow('TFormClass', 'FormTitle')
By
If you need i can send example to you



0
 

Author Comment

by:moonrise
ID: 2776269
Thank you. I write both aplications, but what would be the advantage of sending messages to the application that does the monitoring (instead of using SendMessageTimeout)?
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2776365
the monitor program waits for messages from the main app, which must come at regular intervals, otherwise we have a main app failure. The response from the monitor to the main app is an insurance policy. If you have an app that needs to be monitored it must be important, but if Monitor fails, and then main app fails no-one will know. Using my scenario, failure of either will be noticed.

Either way is not wrong, just different ways to achieve the goal.
0
 

Author Comment

by:moonrise
ID: 2783930
Thank you all.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question