?
Solved

Application is running / not running / hang up

Posted on 2003-02-28
11
Medium Priority
?
290 Views
Last Modified: 2010-04-04
How can i find out if an application is running or not
i know only then exe-name (e.g. prg.exe)
0
Comment
Question by:kostamania
[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
11 Comments
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8045226
check out the www.madshi.net/enumStuff.zip units
when you got the handle simply

if SendMessageTimeout(WHandle, WM_NULL, 0, 0, SMTO_ABORTIFHUNG, 5000, dw1) = 0 then
ShowMessage('Not responding');

:-)
0
 

Expert Comment

by:jsmugen
ID: 8046096
use windows API
if FindWindow('classname', nil) <> 0 then }return window handle
...
classname in delphi are your main form name or you can use other tool like spy++(visual studio) to get the classname.

alternative
FindWindow(0, 'application title name')
0
 
LVL 5

Accepted Solution

by:
Lukasz Lach earned 80 total points
ID: 8047004
but he knows exe file name only, FindWindow won't help...
0
Technology Partners: 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!

 

Author Comment

by:kostamania
ID: 8047097
@anAKiN
in enumstuff is no procedure / function do find the handle of the exe-file
i'm looking for a func. like this

function ExeHandle(prog.exe):Handle



0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8047125
there is an enum function allowing to get the handle by a exe file name... search once again :-)
0
 

Author Comment

by:kostamania
ID: 8047182
@anAKiN
i've fond this
function GetExeType(exefile: string) : TExeType;
but where is the handle ?
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8047193
nope :-)
using GetProcessList where every record in result has a name variable, that is the exe file name...

TProcessList = array of record
  pid       : cardinal;
  name      : string;  // EXE File Name
  exeType   : TExeType;
  threads   : TThreadList;
end;
0
 
LVL 17

Expert Comment

by:geobul
ID: 8047302
Hi,

There is no such thing like 'exe handle'. There are process handles, thread handles, window handles, etc. What you are looking for (IMHO) is a process handle which corresponds to a specific exe name you know beforehand. You may find one process, many processes or nothing. Nothing and one is OK (easy to handle with) but what if you find many instances of one program running at the same time?

Another point is that 'Not Responding' status simply means that a process haven't managed its message queue for a relatively long period of time. It's not guaranteed that this process is not working anymore. This depends on the programmer who wrote it. Let's suppose that this process has entered in a long and heavy loop and the developer has forgotten to add Application.ProcessMessages or similar inside that loop. The result is 'Not Responding'.

I agree with anAKiN. Madshi's enumStuff is the best choise to go. It works on all Windows versions.

Regards, Geo
0
 

Expert Comment

by:CleanupPing
ID: 9317015
kostamania:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9992691
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept anAKiN's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Merry Christmas and happy new year!

kacor
EE Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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