示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            bool  createNew;
            Mutex mutex = new Mutex(true, "SingleInstance", out createNew);

            if (API.FindWindow(null, "EasyStarterByAbelGuaizi") == IntPtr.Zero && createNew)
            {
                StartButton startbutton = new StartButton();
                startbutton.Show();
                API.DealMessage(e.Args);
            }
            else
            {
                API.DealMessage(e.Args);
                Application.Current.Shutdown();
            }
            base.OnStartup(e);
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            bool createNew;
            Mutex mutex = new Mutex(true, "SingleInstance", out createNew);

            if (API.FindWindow(null, "EasyStarterByAbelGuaizi") == IntPtr.Zero && createNew)
            {
                StartButton startbutton = new StartButton();
                startbutton.Show();
                API.DealMessage(e.Args);
            }
            else
            {
                API.DealMessage(e.Args);
                Application.Current.Shutdown();
            }
            base.OnStartup(e);
        }