Z
Zorro
Hi all,
I've got a little problem with my current App.
This app should only start once on each computer.
Currently I make this in following way:
static void Main()
{
int Count = 0;
foreach(System.Diagnostics.Process pro in
System.Diagnostics.Process.GetProcesses())
{
if(pro.ProcessName == "AppName" && Count >= 1)
return;
else if(pro.ProcessName == "AppName ")
Count = 1;
}
Application.Run(new Form1 ());
}
This is very easy.
But now should there two changing's.
1.. When the Application will start again, the running app should be the
active windows
2.. When the Application will start again with arguments, the current app
should be the active window and an Event should fire (Open Form2).
I hope somebody have an idea, how I can implement this changing's.
Thanks,
Z
I've got a little problem with my current App.
This app should only start once on each computer.
Currently I make this in following way:
static void Main()
{
int Count = 0;
foreach(System.Diagnostics.Process pro in
System.Diagnostics.Process.GetProcesses())
{
if(pro.ProcessName == "AppName" && Count >= 1)
return;
else if(pro.ProcessName == "AppName ")
Count = 1;
}
Application.Run(new Form1 ());
}
This is very easy.
But now should there two changing's.
1.. When the Application will start again, the running app should be the
active windows
2.. When the Application will start again with arguments, the current app
should be the active window and an Event should fire (Open Form2).
I hope somebody have an idea, how I can implement this changing's.
Thanks,
Z