using System;
using System.Windows.Forms;

namespace GcDevicePc
{
    static class Program
    {
       
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            bool createNew;
            //Application.Run(new Compound());
            {
                using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
                {
                    if (createNew)
                    {
                        Application.Run(new StartForm());
                        mutex.ReleaseMutex();
                    }
                    else
                    {
                        MessageBox.Show("应用程序已经在运行中...");
                        System.Threading.Thread.Sleep(1000);
                        Application.Exit();
                        System.Diagnostics.Process.GetCurrentProcess().Kill();
                        // System.Environment.Exit(1);
                    }
                }
            }
        }
    }
}
