Hi Max3vil,
A simple solution would be something like this
private void button1_Click(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("notepad");
if (processes.Length 0)
MessageBox.Show("Notepad already started");
else
{
Process p = new Process();
p.StartInfo = new ProcessStartInfo("notepad.exe");
p.Start();
}
}
This is not very robust though. If another program would call itself
notepad the code above will fail.
On Tue, 19 Sep 2006 08:40:01 +0200, Max3vil <no@no.itwrote:
I would like to write an application with 2 button. For each button i
would
like to lounch an other application, and it verify if it is already run.
Any ideas ?
tnx
--
Happy Coding!
Morten Wennevik [C# MVP]