Page 1 of 1

Open a Process only if it is running by using LoadProcess

PostPosted: Tue Feb 17, 2009 1:22 am
by SpeedWing
Q1:
I wonder if it is possible to make a script to check if for example ares.exe is running.


Q2:
I don't understand the LoadProcess function yet, would this be a correct example for it?
the BOOL "bAresStart" would be true if ares.exe is running.
Code: Select all
while bAresStart == true{
LoadProcess(ares_exe);
bAresStart = false;//if ares.exe is opened by Mhs.exe, it stops this script from running.
sleep(10000);//makes the script runs once every 10 seconds...
                        }




Q3:
Can i use the LoadProcess function to check if mhs is able to connect to ares.exe?

Q4:
would it be easier to just make a script that just runs LoadProcess(ares_exe) every 10 seconds, or would this crash mhs if ares.exe does not exists?

PostPosted: Tue Feb 17, 2009 7:42 am
by L. Spiro
There is an example in the help file using LoadProcess().

Nothing can crash MHS. If it is not open, it returns FALSE.

Use On_ProcessIsOpening() to open Ares.exe as soon as it opens.


L. Spiro

Re: Open a Process only if it is running by using LoadProces

PostPosted: Tue Feb 17, 2009 9:21 pm
by tiduswong
SpeedWing wrote:
Code: Select all
while bAresStart == true{
LoadProcess(ares_exe);
bAresStart = false;//if ares.exe is opened by Mhs.exe, it stops this script from running.
sleep(10000);//makes the script runs once every 10 seconds...
                        }



why u need to put make the script runs once every 10 second?

PostPosted: Tue Apr 07, 2009 6:44 pm
by SpeedWing
sorry for my late reply, but i am a little bit lazy and i don't want to open the process everytime.

i just need a small example.