Esempio n. 1
0
        static void Main()
        {
            try
            {
                /// 다국어 테스트 용
                //Thread.CurrentThread.CurrentUICulture = new CultureInfo("ko-KR");
                //Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
                //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN");

                if (ProcessChecker.IsOnlyProcess("GreenLock"))
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new frmMain());
                }
            }
            catch (Exception e)
            {
                frmMain._log.write(e.Message + e.StackTrace);
            }
        }
Esempio n. 2
0
 static void Main()
 {
     if (ProcessChecker.IsOnlyProcess(Application.ProductName))
     {
         //try
         //{
         //}
         //catch (Exception e)
         //{
         //    MessageBox.Show(e.Message);
         //    Console.Write(e.Message + "Program");
         //    System.Environment.Exit(0);
         //}
         //finally
         //{
         //    Application.EnableVisualStyles();
         //    Application.SetCompatibleTextRenderingDefault(false);
         //    Application.Run(new MainForm());
         //}
         try
         {
             IntPtr ptr = FindWindow(null, "MainForm");
             if (ptr != IntPtr.Zero)
             {
                 SendMessage(ptr, 0x0010, 0, 0);
                 System.Environment.Exit(0);
             }
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.Run(new MainForm());
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.ToString() + "Program");
         }
     }
 }