mIRC Home    About    Download    Register    News    Help

Print Thread
#222416 19/06/10 11:57 AM
Joined: Nov 2004
Posts: 21
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2004
Posts: 21
Hi there,

I have a simple script which triggers a program to be run when text is entered.

Is it possible to trigger another event when the program finishes running and closes?

Thanks.

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Is it possible? Yes. You can do that using com statements. I do not know com statements well enough to help you out with the code though. Hopefully someone else will show up and be able to tell you how.


Yar
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Ultimately it depends what kind of program it is. If it's a commandline utility like cmd.exe, you can use a dll like exec.dll to monitor the output and when it ends (sort of). If it's some GUI application that's a little more difficult.

You *can* do this with COM, there's a script floating around that basically does what exec.dll does without the need of a DLL, but it's the same concept.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Sep 2009
Posts: 52
Z
ziv Offline
Babel fish
Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
Would continuously(or timely), checking if a com connection can be established with the external application work?
Cos that should work for both, methinks...

Code:
alias Test {
  comeopen test $1
  if $comerr echo -a The application could not be reached.
  else {
    echo -a The application was reached successfully.  
    comclose test 
  }
}


Something like this?
I have no experience with this sort of things smirk

Good luck,
ziv.


Link Copied to Clipboard