In article <uw**************@TK2MSFTNGP09.phx.gbl>, "pnp" <pnp.at.softlab.ece.ntua.gr>
says...
What's the best way to check whether an app is running so if one tries to
open it again it will not open a second instance of the application but will
give focus to the already open one maximizing it...
-Peter
Try this in your main...
=====================================
System.Threading.Mutex appMutex = new System.Threading.Mutex(true,"AppName");
if(appMutex.WaitOne(0, false))
{
try
{
Application.Run(new FormMain());
}
catch(Exception EX)
{
MessageBox.Show("Application Error!!\r\n" + EX.Message);
}
}
else
{
MessageBox.Show("The application is already loaded.");
}
=====================================