Ejemplo n.º 1
0
        private Hotkey Windows_CreateRestoreHotkey()
        {
            // Hotkey section.
            Hotkey toRegister = new Hotkey(Keys.Back, true, true, false, false);

            toRegister.Pressed += delegate
            {
                if (this.WindowState == FormWindowState.Normal)
                {
                    this.WindowState = FormWindowState.Minimized;
                    this.Visible     = false;
                }
                else if (this.WindowState == FormWindowState.Minimized)
                {
                    // Need to make it visible first, otherwise it ignores the WindowState change.
                    this.Visible     = true;
                    this.WindowState = FormWindowState.Normal;
                }
            };

            if (!toRegister.GetCanRegister(this))
            {
                // TODO
            }
            else
            {
                toRegister.Register(this);
            }

            return(toRegister);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Activate CtrlCVMaster Shortcut Key
        /// </summary>
        public void ActivateShortcutKey(Keys keys, bool shift, bool control, bool alt, bool windows)
        {
            try
            {
                if (this.activateKey != null)
                {
                    this.activateKey.Unregister();
                }

                this.activateKey = new Hotkey();

                activateKey.KeyCode = keys;
                activateKey.Shift   = shift;
                activateKey.Control = control;
                activateKey.Alt     = alt;
                activateKey.Windows = windows;

                activateKey.Pressed += new HandledEventHandler(activateHk_Pressed);

                if (activateKey.GetCanRegister(this))
                {
                    activateKey.Register(this);
                }
            }
            catch (Exception ex)
            {
                ConsoleLib.ConsoleLib.WriteFormatted(ex.ToString() + "                    ", t);
                ConsoleLib.ConsoleLib.WriteLine(Environment.NewLine);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 注册热键
        /// </summary>
        private void RegHotKey()
        {
            if (string.IsNullOrWhiteSpace(Resources.GetRes().CashDrawer))
            {
                return;
            }
            try
            {
                hk.KeyCode  = Keys.Z;
                hk.Alt      = true;
                hk.Pressed += delegate
                {
                    Common.GetCommon().OpenCashDrawer();
                };

                if (!hk.GetCanRegister(this))
                {
                    ExceptionPro.ExpErrorLog("Open cash drawer key can't register!");
                }
                else
                {
                    hk.Register(this);
                }
            }
            catch (Exception ex)
            {
                ExceptionPro.ExpLog(ex);
            }
        }
Ejemplo n.º 4
0
        public Form1()
        {
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            InitializeComponent();
            dGrid.RowHeadersVisible = false;
            dGrid.LostFocus        += delegate { this.Hide(); isShown = false; };

            //bookmarks = Library.getChromeBookmarks();
            bookmarks = Library.getFireBookmarks();

            popGrid();

            hk          = new Hotkey();
            hk.KeyCode  = Keys.F2;
            hk.Windows  = false;
            hk.Pressed += getHotKey;

            if (!hk.GetCanRegister(this))
            {
                Console.WriteLine("Whoops, looks like attempts to register will fail or throw an exception, show an error / visual user feedback");
            }
            else
            {
                hk.Register(this);
            }

            this.Opacity = 0;
            form         = this;
            //button1.Text = "\u269B";
        }
Ejemplo n.º 5
0
 public void SetForm(Form form)
 {
     mForm = form;
     if (hotkey.GetCanRegister(mForm))
     {
         hotkey.Register(mForm);
     }
 }
Ejemplo n.º 6
0
 ///<summary>
 ///  Call first
 ///</summary>
 public PathControl(PathProfile pathProfile)
 {
     InitializeComponent();
     DoubleBuffered = true;
     GraphView.BringToFront();
     _pathProfile      = pathProfile;
     _pathLoadedThread = new Thread(LoadPath)
     {
         IsBackground = true
     };
     _pathLoadedThread.Start();
     if (LazySettings.SetupUseHotkeys)
     {
         _f7          = new Hotkey();
         _f7.KeyCode  = Keys.F7;
         _f7.Windows  = false;
         _f7.Pressed += delegate { AddSpot(); };
         try
         {
             if (!_f7.GetCanRegister(this))
             {
                 Logging.Write("Cannot register F7 as hotkey");
             }
             else
             {
                 _f7.Register(this);
             }
         }
         catch
         {
             Logging.Write("Cannot register F7 as hotkey");
         }
         _f8          = new Hotkey();
         _f8.KeyCode  = Keys.F8;
         _f8.Windows  = false;
         _f8.Pressed += delegate { AddNode(); };
         try
         {
             if (!_f8.GetCanRegister(this))
             {
                 Logging.Write("Cannot register F8 as hotkey");
             }
             else
             {
                 _f8.Register(this);
             }
         }
         catch
         {
             Logging.Write("Cannot register F8 as hotkey");
         }
     }
 }
Ejemplo n.º 7
0
 private void RegisterHotKeys()
 {
     if (LazySettings.SetupUseHotkeys && !_hotKeysLoaded)
     {
         _f10          = new Hotkey();
         _f10.KeyCode  = Keys.F10;
         _f10.Windows  = false;
         _f10.Pressed += delegate { PauseBot(); };
         try
         {
             if (!_f10.GetCanRegister(this))
             {
                 Logging.Write("Cannot register F10 as hotkey");
             }
             else
             {
                 _f10.Register(this);
             }
         }
         catch
         {
             Logging.Write("Cannot register F10 as hotkey");
         }
         _f9          = new Hotkey();
         _f9.KeyCode  = Keys.F9;
         _f9.Windows  = false;
         _f9.Pressed += delegate { StartStopBotting(); };
         try
         {
             if (!_f9.GetCanRegister(this))
             {
                 Logging.Write("Cannot register F9 as hotkey");
             }
             else
             {
                 _f9.Register(this);
             }
         }
         catch
         {
             Logging.Write("Cannot register F9 as hotkey");
         }
         _hotKeysLoaded = true;
     }
 }
Ejemplo n.º 8
0
        internal BGLApplicationContext()
        {
            // только создаем форму, она все равно нужна
            // чтобы слушать хоткеи
            form = new Form();

            // создаем и регистрируем глобайльный хоткей
            hk = new Hotkey(Keys.J, false, true, true, false); /////////// <- hotkey

            hk.Pressed += delegate { ActionProcess(); };
            if (hk.GetCanRegister(form))
            {
                hk.Register(form);
            }

            // Вешаем событие на выход
            Application.ApplicationExit += Application_ApplicationExit;
        }
Ejemplo n.º 9
0
        // Récupération du raccourci de la hotkey
        private void registerHotkey(String raccourci, ref Hotkey hotkey, HotkeyMethodDelegate callback)
        {
            //Récupération et ajout des touches spéciales
            if (raccourci.Contains("CTRL"))
            {
                hotkey.Control = true;
            }
            if (raccourci.Contains("ALT"))
            {
                hotkey.Alt = true;
            }
            if (raccourci.Contains("MAJ"))
            {
                hotkey.Shift = true;
            }
            if (raccourci.Contains("WIN"))
            {
                hotkey.Windows = true;
            }

            //Récupération de la lettre
            String lettre = raccourci.Substring(raccourci.LastIndexOf("+") + 1);

            //Si lettre reconnue, ajout de celle-ci et enregistrement de la combinaison
            if (!Enum.IsDefined(typeof(Keys), lettre))
            {
                afficheMessage("Hotkey", "Erreur de formatage du fichier de config");
            }
            else
            {
                hotkey.KeyCode  = (Keys)Enum.Parse(typeof(Keys), lettre, false);
                hotkey.Pressed += new System.ComponentModel.HandledEventHandler(callback);

                if (!hotkey.GetCanRegister(invokeControl))
                {
                    afficheMessage("Hotkey", "Impossible d'enregistrer le raccourci");
                }
                else
                {
                    hotkey.Register(invokeControl);
                }
            }
        }
Ejemplo n.º 10
0
 private void Start()
 {
     if (_firstTime)
     {
         LoadFirstTime();
         _firstTime = false;
     }
     if (File.Exists(OurDirectory + "\\Rotations\\" + RotationSettings.LoadedRotationManager + ".xml"))
     {
         RotationManagerController = new RotationManagerController();
         RotationManagerController.Load(OurDirectory + "\\Rotations\\" + RotationSettings.LoadedRotationManager +
                                        ".xml");
     }
     foreach (Rotation rotation in RotationManagerController.Rotations.Where(r => r.Active))
     {
         try
         {
             CheckBuffAndKeys(rotation.Rules.GetRules);
             var hotkey = new Hotkey();
             hotkey.Windows = rotation.Windows;
             hotkey.Shift   = rotation.Shift;
             hotkey.Alt     = rotation.Alt;
             hotkey.Control = rotation.Ctrl;
             Rotation rotation1 = rotation;
             hotkey.KeyCode  = (Keys)RotationSettings.KeysList.FirstOrDefault(k => k.Text == rotation1.Key).Code;
             hotkey.Pressed += delegate { StartRotation(rotation1.Name); };
             if (!hotkey.GetCanRegister(this))
             {
                 Logging.Write("Cannot register {0} as hotkey", rotation.Key);
             }
             else
             {
                 hotkey.Register(this);
                 _hotKeys.Add(hotkey);
             }
         }
         catch
         {
             Logging.Write("Cannot register {0} as hotkey", rotation.Key);
         }
     }
 }
Ejemplo n.º 11
0
        internal SUApplicationContext()
        {
            // только создаем форму, она все равно нужна
            // чтобы слушать хоткеи
            form = new Form();

            // создаем и регистрируем глобайльный хоткей
            hk = new Hotkey(Keys.L, false, true, true, false); /////////// <- hotkey

            hk.Pressed += delegate { ActionProcess(); };
            if (hk.GetCanRegister(form))
            {
                hk.Register(form);
            }

            // хоткей для выхода из системы
            hkLogoff          = new Hotkey(Keys.E, false, true, true, false); /////////// <- hotkey
            hkLogoff.Pressed += delegate { UserLogoff(); };
            if (hkLogoff.GetCanRegister(form))
            {
                hkLogoff.Register(form);
            }

            // хоткей для выхода из системы
            hkKodi          = new Hotkey(Keys.K, false, true, true, false); /////////// <- hotkey
            hkKodi.Pressed += delegate { LaunchKodi(); };
            if (hkKodi.GetCanRegister(form))
            {
                hkKodi.Register(form);
            }

            // Вешаем событие на выход
            Application.ApplicationExit += Application_ApplicationExit;

            // отслеживаем событие входа в сессию
            SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;

            //переключаем мониторы
            Thread.Sleep(3000);
            SwitchMonitor(false);
        }
Ejemplo n.º 12
0
        private void SetHotkey()
        {
            _hotkey = new Hotkey
            {
                KeyCode = Keys.D8,
                Control = true,
                Alt     = true,
                Shift   = true
            };
            _hotkey.Pressed += delegate { ServiceLocator.Current.GetInstance <IImageService>().DownloadImage(); };

            var window = ViewsManager.Instance.MainWindow;

            if (!_hotkey.GetCanRegister(window))
            {
                Console.WriteLine(
                    "Whoops, looks like attempts to register will fail or throw an exception, show an error/visual user feedback");
            }
            else
            {
                _hotkey.Register(window);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 注册热键(为备注)
        /// </summary>
        private void RegHotKey2()
        {
            try
            {
                hk2.KeyCode  = System.Windows.Forms.Keys.F9;
                hk2.Pressed += delegate
                {
                    Oybab.Res.View.Component.RemarkEvent.Instance.ActionRemark(null, null, null);
                };

                if (!hk2.GetCanRegister(this))
                {
                    ExceptionPro.ExpErrorLog("Open remark key can't register!");
                }
                else
                {
                    hk2.Register(this);
                }
            }
            catch (Exception ex)
            {
                ExceptionPro.ExpLog(ex);
            }
        }
Ejemplo n.º 14
0
        private void applyShortcutButton_Click(object sender, EventArgs e)
        {
            try
            {
                int notMetaCount = shortcutKeys.Count(k => !IsMetaKey(k));
                if (notMetaCount == 0)
                {
                    ShowErrorMessage("You should also choose one character that is not CTRL, SHIFT, ALT or WIN");
                    return;
                }

                bool ctrl  = false;
                bool shift = false;
                bool alt   = false;
                bool win   = false;
                Keys key   = Keys.F19;

                foreach (Keys item in shortcutKeys)
                {
                    if (item == Keys.ControlKey)
                    {
                        ctrl = true;
                    }
                    else if (item == Keys.ShiftKey)
                    {
                        shift = true;
                    }
                    else if (item == Keys.LWin || item == Keys.RWin)
                    {
                        win = true;
                    }
                    else if (item == Keys.Alt || item == Keys.Menu)
                    {
                        alt = true;
                    }
                    else
                    {
                        key = item;
                    }
                }

                if (hotKey != null && hotKey.Registered)
                {
                    hotKey.Unregister();
                }

                hotKey          = new Hotkey(key, shift, ctrl, alt, win);
                hotKey.Pressed += (hkSender, hkArgs) => ShowScreenShotForm();

                if (hotKey.GetCanRegister(shortcut))
                {
                    hotKey.Register(shortcut);
                    new UserSettings().Shortcut = shortcutKeys;
                }
                else
                {
                    MessageBox.Show(this, "There is another application using this combination already. Please choose another one",
                                    "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 15
0
        private Hotkey SetHotKey(Keys keys, bool shift, bool control, bool alt, bool windows, ClipboardInfo selectedInfo)
        {
            try
            {
                int index = selectedInfo.INDEX;

                Hotkey hk = new Hotkey();
                hk.KeyCode = keys;
                hk.Shift   = shift;
                hk.Control = control;
                hk.Alt     = alt;
                hk.Windows = windows;

                switch (index)
                {
                case 1:
                    hk.Pressed += new HandledEventHandler(hk_Pressed1);
                    break;

                case 2:
                    hk.Pressed += new HandledEventHandler(hk_Pressed2);
                    break;

                case 3:
                    hk.Pressed += new HandledEventHandler(hk_Pressed3);
                    break;

                case 4:
                    hk.Pressed += new HandledEventHandler(hk_Pressed4);
                    break;

                case 5:
                    hk.Pressed += new HandledEventHandler(hk_Pressed5);
                    break;

                case 6:
                    hk.Pressed += new HandledEventHandler(hk_Pressed6);
                    break;

                case 7:
                    hk.Pressed += new HandledEventHandler(hk_Pressed7);
                    break;

                case 8:
                    hk.Pressed += new HandledEventHandler(hk_Pressed8);
                    break;

                case 9:
                    hk.Pressed += new HandledEventHandler(hk_Pressed9);
                    break;

                case 10:
                    hk.Pressed += new HandledEventHandler(hk_Pressed0);
                    break;

                default:
                    break;
                }

                if (hk.GetCanRegister(this))
                {
                    hk.Register(this);
                    return(hk);
                }

                return(null);
            }
            catch (Exception ex)
            {
                ConsoleLib.ConsoleLib.WriteFormatted(ex.ToString() + "                    ", t);
                ConsoleLib.ConsoleLib.WriteLine(Environment.NewLine);
                return(null);
            }
        }
Ejemplo n.º 16
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // startup checks
            string dir = Directory.GetCurrentDirectory() + "\\";

            if (ContainsUnicodeCharacter(dir))
            {
                MessageBox.Show("The installation path (" + dir + ") contains special characters. Please install GeDoSaTo to a path with only ANSI characters.",
                                "Installation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
            if (!IsAdministrator())
            {
                MessageBox.Show("Please run GeDoSaToTool as Administrator (to enable dll injection).",
                                "Privilege Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
            if (IsSecureBootEnabled())
            {
                MessageBox.Show("It appears that you are using a Windows 8 or 10 system with UEFI secure boot enabled. This prevents GeDoSaTo from working correctly. Please see the Readme for details.",
                                "Secure Boot Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            try {
                Microsoft.Win32.Registry.SetValue(REG_PATH, "InstallPath", dir);
                installLabel.Text = "Installation path: " + dir;
            }
            catch (Exception ex) {
                installLabel.Text = "Error setting Installation path: \n" + ex.Message;
            }

            // load native dll
            try {
                native.init();
            }
            catch (Exception ex) {
                dllVersionlabel.Text = "Error loading dll:\n " + ex.Message;
            }
            dllVersionlabel.Text = native.getVersionText();

            // setup global hotkey
            Hotkey hk = new Hotkey();

            hk.KeyCode  = Keys.G;
            hk.Control  = true;
            hk.Alt      = true;
            hk.Pressed += delegate {
                if (deactivateButton.Enabled)
                {
                    deactivateButton_Click(null, null);
                }
                else
                {
                    activateButton_Click(null, null);
                }
            };
            if (!hk.GetCanRegister(this))
            {
                globalHotkeyLabel.Text = "Error: Could not register global hotkey.";
            }
            else
            {
                hk.Register(this);
                globalHotkeyLabel.Text = "Global hotkey to toggle: " + hk.ToString();
            }

            // check autostart state
            Microsoft.Win32.RegistryKey skey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AUTOSTART_REG_PATH, true);
            if (skey.GetValue("GeDoSaToTool") != null)
            {
                startupCheckBox.Checked = true;
            }

            // check balloon state
            var balloon = Microsoft.Win32.Registry.GetValue(REG_PATH, "HideBalloon", "False");

            if (balloon != null)
            {
                balloonCheckBox.Checked = (string)balloon == "True";
            }

            // disable dangling alternative injection (from improper shutdown)
            string dllfn = GetShimDllPath();

            if (dllfn.Length == 0)
            {
                MessageBox.Show("Could not determine dll directory. Please reinstall to a different location.",
                                "Installation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
            string initval = (string)Microsoft.Win32.Registry.GetValue(INJECTION_REG_PATH, "AppInit_DLLs", "");
            string val     = initval.Replace(dllfn + ",", "");

            val = val.Replace(dllfn, "");
            if (val != initval)
            {
                Microsoft.Win32.Registry.SetValue(INJECTION_REG_PATH, "AppInit_DLLs", val);
                MessageBox.Show("Old registry entries for injection found and cleared. Please make sure to close GeDoSaToTool properly.",
                                "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            // activate automatically if set to do so
            if (autoActivate)
            {
                activateButton_Click(null, null);
            }

            settings.AddRange(native.getSettingsString().Split(','));

            // minimize if requested
            if (startMinimized)
            {
                WindowState = FormWindowState.Minimized;
                MainForm_Resize(null, null);
            }

            // check for updates
            updateButton.Enabled = false;
            updateButton.Text    = "Checking for updates...";
            ThreadPool.QueueUserWorkItem(delegate {
                try {
                    var cli = new WebClient();
                    string github_version = cli.DownloadString("https://raw.githubusercontent.com/PeterTh/gedosato/master/source/version.cpp");
                    var buildReg          = new Regex(@"const unsigned VER_BUILD = (\d+);");
                    var verReg            = new Regex(@"version \d+\.\d+\.(\d+)");
                    int current           = Int32.Parse(verReg.Match(native.getVersion()).Groups[1].ToString());
                    int latest            = Int32.Parse(buildReg.Match(github_version).Groups[1].ToString());
                    if (current < latest)
                    {
                        Invoke((MethodInvoker) delegate {
                            updateButton.Enabled = true;
                            updateButton.Text    = "Update to\nbuild " + latest;
                        });
                    }
                    else
                    {
                        Invoke((MethodInvoker) delegate {
                            updateButton.Text = "Up to date";
                        });
                    }
                }
                catch (Exception) {
                    Invoke((MethodInvoker) delegate {
                        updateButton.Text = "Error checking for updates (offline?)";
                    });
                }
            });
        }
Ejemplo n.º 17
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // startup checks
            string dir = Directory.GetCurrentDirectory() + "\\";

            if (ContainsUnicodeCharacter(dir))
            {
                MessageBox.Show("The installation path (" + dir + ") contains special characters. Please install GeDoSaTo to a path with only ANSI characters.",
                                "Installation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
            if (!IsAdministrator())
            {
                MessageBox.Show("Please run GeDoSaToTool as Administrator (to enable dll injection).",
                                "Privilege Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }

            try
            {
                Microsoft.Win32.Registry.SetValue(REG_PATH, "InstallPath", dir);
                installLabel.Text = "Installation path: " + dir;
            }
            catch (Exception ex)
            {
                installLabel.Text = "Error setting Installation path: \n" + ex.Message;
            }

            // load whitelist state
            try
            {
                bool useBlacklist = (string)Microsoft.Win32.Registry.GetValue(REG_PATH, "UseBlacklist", false) == "True";
                if (useBlacklist)
                {
                    blacklistRadioButton.Checked = true;
                    whitelistRadioButton.Checked = false;
                }
            }
            catch (Exception) { }
            whitelistRadioButton_CheckedChanged(null, null);
            blacklistRadioButton_CheckedChanged(null, null);

            // load native dll
            try
            {
                native.init();
            }
            catch (Exception ex)
            {
                dllVersionlabel.Text = "Error loading dll:\n " + ex.Message;
            }
            dllVersionlabel.Text = native.getVersionText();

            // setup global hotkey
            Hotkey hk = new Hotkey();

            hk.KeyCode  = Keys.G;
            hk.Windows  = true;
            hk.Pressed += delegate {
                if (deactivateButton.Enabled)
                {
                    deactivateButton_Click(null, null);
                }
                else
                {
                    activateButton_Click(null, null);
                }
            };
            if (!hk.GetCanRegister(this))
            {
                globalHotkeyLabel.Text = "Error: Could not register global hotkey.";
            }
            else
            {
                hk.Register(this);
                globalHotkeyLabel.Text = "Global hotkey to toggle: " + hk.ToString();
            }

            // load event handle
            try
            {
                bool createNewEvent = false;
                var  users          = new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null);
                var  rule           = new EventWaitHandleAccessRule(users, EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify | EventWaitHandleRights.FullControl, AccessControlType.Allow);
                var  security       = new EventWaitHandleSecurity();
                security.AddAccessRule(rule);
                unloadEvent = new EventWaitHandle(false, EventResetMode.ManualReset, "Global\\GeDoSaToUnloadEvent", out createNewEvent, security);
                if (!createNewEvent)
                {
                    unloadEvent.Set();
                    unloadEvent.Reset();
                }
                unloadEventLabel.Text = "Unload event created (New: " + createNewEvent + ")";
            }
            catch (Exception ex)
            {
                unloadEventLabel.Text = "Error: Could not create unload event:\n" + ex.Message;
            }


            // check autostart state
            Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AUTOSTART_REG_PATH, true);
            if (key.GetValue("GeDoSaToTool") != null)
            {
                startupCheckBox.Checked = true;
            }

            // disable dangling alternative injection (from improper shutdown)
            string dllfn   = Directory.GetCurrentDirectory() + "\\" + "GeDoSaTo.dll";
            string initval = (string)Microsoft.Win32.Registry.GetValue(INJECTION_REG_PATH, "AppInit_DLLs", "");
            string val     = initval.Replace(dllfn + ",", "");

            val = val.Replace(dllfn, "");
            if (val != initval)
            {
                Microsoft.Win32.Registry.SetValue(INJECTION_REG_PATH, "AppInit_DLLs", val);
                MessageBox.Show("Old registry entries for alternative injection found and cleared. Please make sure to close GeDoSaToTool properly.",
                                "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            // activate automatically if set to do so
            if (autoActivate)
            {
                activateButton_Click(null, null);
            }

            settings.AddRange(native.getSettingsString().Split(','));

            // minimize if requested
            if (startMinimized)
            {
                WindowState = FormWindowState.Minimized;
                MainForm_Resize(null, null);
            }

            // check for updates
            updateButton.Enabled = false;
            updateButton.Text    = "Checking for updates...";
            ThreadPool.QueueUserWorkItem(delegate {
                try
                {
                    var cli = new WebClient();
                    string github_version = cli.DownloadString("https://raw.githubusercontent.com/PeterTh/gedosato/master/source/version.cpp");
                    var buildReg          = new Regex(@"const unsigned VER_BUILD = (\d+);");
                    var verReg            = new Regex(@"version \d+\.\d+\.(\d+)");
                    int current           = Int32.Parse(verReg.Match(native.getVersion()).Groups[1].ToString());
                    int latest            = Int32.Parse(buildReg.Match(github_version).Groups[1].ToString());
                    if (current < latest)
                    {
                        Invoke((MethodInvoker) delegate
                        {
                            updateButton.Enabled = true;
                            updateButton.Text    = "Update to\nbuild " + latest;
                        });
                    }
                    else
                    {
                        Invoke((MethodInvoker) delegate
                        {
                            updateButton.Text = "Up to date";
                        });
                    }
                }
                catch (Exception)
                {
                    Invoke((MethodInvoker) delegate
                    {
                        updateButton.Text = "Error checking for updates (offline?)";
                    });
                }
            });
        }