static void Main() { CoolShotApplicationContext applicationContext = null; if (mutex.WaitOne(TimeSpan.Zero, true)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); applicationContext = new CoolShotApplicationContext(); Application.Run(applicationContext); mutex.ReleaseMutex(); } else { MessageBox.Show("CoolShot is running!"); } }