By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,910 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,910 IT Pros & Developers. It's quick & easy.

how to finde out in C# that a prossess "exe" is allready runningor not ?

P: n/a
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani
Nov 30 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
raj
i used the win32 api calls findwinow, etc in my last app
i am sure there are better ways


"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Nov 30 '05 #2

P: n/a
raj
sorry didn t completely answer your question

i used FindWindow api calls for my last app, it wored well.

I would use a timer with interval of 1000 and on timer tick event call the
findwindow api.


"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Nov 30 '05 #3

P: n/a

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani


To find an instance of a running process, you can use the static
"GetProcessesByName" method of the Process class.
You can set-up a timer using the various Timer classes in the framework,
check System.Timers, System.Threading.Timers or the
System.Windows.Forms.Timer classes.
Question is, why exactly do you need to know if an exe is already running?

Willy.

Nov 30 '05 #4

P: n/a
try the following line of code worked for me

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="/*prossess "exe" name*/ ")
{
// Log the Event, here u can get when the process
is started or closed
}
}

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Dec 1 '05 #5

P: n/a
thank you :)

milk-jam wrote:
try the following line of code worked for me

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="/*prossess "exe" name*/ ")
{
// Log the Event, here u can get when the process
is started or closed
}
}

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani


Dec 1 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.