static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
bool result;
var mutex = new System.Threading.Mutex(true, "UniqueAppId", out result);
if (!result)
{
MessageBox.Show("Another instance is already running.", "Single Instance App");
return;
}
Application.Run(new Home());
GC.KeepAlive(mutex);
}
}