Hi Roland,
Here is the code to determine if the same app is running.
[STAThread]
static void Main()
{
Process [] processes = Process.GetProcessesByName("Your program name goes
here");
if (processes.Length != 1)
{
MessageBox.Show("There is another instance of the Application, the
current one will be closed");
return;
}
else
Application.Run(new Form1());
}
>Hi,
>
>What is the coding to determine if a compiled (Built project) is already running so that the user cannot have more than one copy running.
>
>
>Also what would the coding be to determine if a winform is already running that that the user cannot open two windows of the same form?
>
>
>Thanks
>Roland
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi