Beispiel #1
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException +=
                new UnhandledExceptionEventHandler(UnhandledException);

            Manager = new Superscrot.Manager();
            LoadSettings();

            CommandlineParser cmd = new CommandlineParser(args);

            if (startedWithDefaultSettings || cmd["config"] != null)
            {
                ShowConfigEditor();
            }

            bool created = false;

            startupEventHandle = new EventWaitHandle(false,
                                                     EventResetMode.ManualReset,
                                                     Environment.UserName + "SuperscrotStartup", out created);
            if (created)
            {
                if (!Manager.InitializeKeyboardHook())
                {
                    Exit();
                    return;
                }
                Tray.Show();
                Application.Run();
            }
            else
            {
                MessageBox.Show(SR.InstanceAlreadyRunning, Application.ProductName,
                                MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
        }
Beispiel #2
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException +=
                new UnhandledExceptionEventHandler(UnhandledException);

            Manager = new Superscrot.Manager();
            LoadSettings();

            CommandlineParser cmd = new CommandlineParser(args);
            if (startedWithDefaultSettings || cmd["config"] != null)
            {
                ShowConfigEditor();
            }

            bool created = false;
            startupEventHandle = new EventWaitHandle(false,
                EventResetMode.ManualReset,
                Environment.UserName + "SuperscrotStartup", out created);
            if (created)
            {
                if (!Manager.InitializeKeyboardHook())
                {
                    Exit();
                    return;
                }
                Tray.Show();
                Application.Run();
            }
            else
            {
                MessageBox.Show(SR.InstanceAlreadyRunning, Application.ProductName,
                    MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
        }