Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

How to detect process exit?

If you have a question or need help, this is the place to be.
Post Reply
Jani
Posts: 9
Joined: Tue Sep 01, 2009 10:17 pm

How to detect process exit?

Post by Jani »

Hello,

How I can detect when a process exits? The process doesn't have any windows Task.Destroyed isn't an option (afaik).
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: How to detect process exit?

Post by Pako »

Search on this forum and you can find a plugin called Process Watcher.

Pako
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: How to detect process exit?

Post by jinxdone »

There is a checkbox in the "start application" action to wait for the specified program to finish before continuing. However using that feature will block EG from processing events while it's waiting.


If you wanted to you could also work around the problem with a small batch file. The following command will wait for someprogram.exe to finish before the second statement (which in this case triggers an event in EG).

Code: Select all

start /wait someprgorgam.exe && "c:\Program Files\EventGhost\EventGhost.exe" -e ProgramFinished
or if you want to launch directly from eg (with start application action) or a windows shortcut.

Code: Select all

cmd.exe /c start /wait someprgorgam.exe && "c:\Program Files\EventGhost\EventGhost.exe" -e ProgramFinished
Yes, it's ugly, but this kind of approach should work just fine for batch commands that just take a while to run.

-jinxdone
HaliburtonZeke
Posts: 1
Joined: Wed Jan 11, 2012 4:49 pm

Re: How to detect process exit?

Post by HaliburtonZeke »

Win7 . This batch job starts EventGhost which starts MediaMonkey. Everything runs fine but when I close MM, the cmd window closes but EG doesn't close. I'm stuck. What am I doing wrong? Here's my batch job.

cd C:\Program Files (x86)\
Start EventGhost\EventGhost.exe -hide -configdir N:\Program Info\EventGhost for MediaMonkey
cd C:\
start /wait "" "C:\Program Files (x86)\MediaMonkey\Mediamonkey.exe" && "C:\Program Files (x86)\EventGhost\EventGhost.exe" -e ProgramFinished
cls
exit
1337
Posts: 2
Joined: Sat Jan 24, 2015 4:56 am

Re: How to detect process exit?

Post by 1337 »

Is there a way to not only look at a process, but look at what the title bar says?
Post Reply