Esempio n. 1
0
        static void Main(string[] arg)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                mutex = new System.Threading.Mutex(false, @"{747690E4-BCE9-4949-9B79-FBAC7E700D63}");
                if (!mutex.WaitOne(0, false))
                {
                    Process prevProcess = GetPreviousProcess();
                    if (prevProcess != null && prevProcess.MainWindowHandle != IntPtr.Zero)
                    {
                        // 起動中のアプリケーションを最前面に表示
                        WakeupWindow(prevProcess.MainWindowHandle);
                    }
                    return;
                }

                switch (arg.Length)
                {
                    case 0:
                        Application.Run(new Form1());
                        break;
                    case 3:
                        loginState form = new loginState(arg[0], arg[1], bool.Parse(arg[2]));
                        Application.Run(form);
                        break;
                }
            }
            finally
            {
                mutex.Close();
            }
        }
Esempio n. 2
0
        private void launchAva(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count < 1) return;
            string guid = getGuidFromListViewSelectedItem();

            foreach (Account account in accountList)
            {
                if (account.guid.Equals(guid))
                {
                    loginState form = new loginState(account.id, account.password, account.startMumble);
                    form.login();
                    form.ShowDialog();
                }
            }
        }