Example #1
0
        static void Main()
        {
            BootTools.OnBoot();

            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding);

            Mutex procMutex = new Mutex(false, APP_IDENT);

            if (procMutex.WaitOne(0) && GlobalProcMtx.Create(APP_IDENT, APP_TITLE))
            {
                CheckSelfDir();
                CheckCopiedExe();

                // orig >

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainWin());

                // < orig

                GlobalProcMtx.Release();
                procMutex.ReleaseMutex();
            }
            procMutex.Close();
        }
Example #2
0
		static void Main()
		{
			BootTools.OnBoot();

			Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
			AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
			SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding);

			Mutex procMutex = new Mutex(false, APP_IDENT);

			if (procMutex.WaitOne(0) && GlobalProcMtx.Create(APP_IDENT, APP_TITLE))
			{
				CheckSelfDir();
				CheckCopiedExe();

				Gnd.NormLog = new Logger(StringTools.Combine(
					BootTools.SelfDir,
					Path.GetFileNameWithoutExtension(BootTools.SelfFile) + "_normal.log"
					));

				Utils.AntiWindowsDefenderSmartScreen();

				Gnd.ConvLog = new Logger(StringTools.Combine(
					BootTools.SelfDir,
					Path.GetFileNameWithoutExtension(BootTools.SelfFile) + "_conversion.log"
					));

				Gnd.LoadData();

				// orig >

				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new MainWin());

				// < orig

				Gnd.SaveData();

				Gnd.NormLog.Close();
				Gnd.ConvLog.Close();

				GlobalProcMtx.Release();
				procMutex.ReleaseMutex();
			}
			procMutex.Close();
		}
Example #3
0
        static void Main()
        {
            BootTools.OnBoot();

            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            SystemEvents.SessionEnding += new SessionEndingEventHandler(SessionEnding);

            Mutex procMutex = new Mutex(false, "{b68179af-7285-4a8c-a16e-f36b107e42cc}");

            if (procMutex.WaitOne(0) && GlobalProcMtx.Create("{82820e8e-4256-4c75-87a2-9a9851f46c5b}", APP_TITLE))
            {
                CheckSelfDir();
                CheckCopiedExe();

                Gnd.Init();
                Gnd.LoadConf();
                Gnd.LoadFromFile();

                // orig >

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainWin());

                // < orig

                // ここではフォームは開けない -> MainWin.cs CloseWindow()

                Gnd.SaveToFile();

                GlobalProcMtx.Release();
                procMutex.ReleaseMutex();
            }
            procMutex.Close();
        }