Exemplo n.º 1
0
        static void Main()
        {
            SetProcessDPIAware();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (CheckMutex())
            {
                MessageBox.Show("Waiting for another task...", "KrkrExtract", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(-1);
            }


            var args = Environment.GetCommandLineArgs();

            if (args.Length >= 2)
            {
                string ProgramName = args[1];
                if (KrkrExtract.CreateProcessInternalWithDll(ProgramName, KrkrMode.NORMAL) == NativeHelper.INVALID_HANDLE_VALUE)
                {
                    MessageBox.Show("Failed to launch executable...", "KrkrExtract", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Environment.Exit(-1);
                }

                UILoader.LoadUIAndRun();
            }
            else
            {
                Application.Run(new KrkrExtract());
                UILoader.LoadUIAndRun();
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            SetProcessDPIAware();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var args = Environment.GetCommandLineArgs();

            if (args.Length >= 2)
            {
                string ProgramName = args[1];
                if (!KrkrExtract.CreateProcessInternalWithDll(ProgramName, KrkrMode.NORMAL))
                {
                    MessageBox.Show("Failed to launch executable...", "KrkrExtract", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                Application.Run(new KrkrExtract());
            }
        }