Пример #1
0
        public MainWindow(string[] args)
        {
            InitializeComponent();
            notifyIcon.Visible = false;

            // check if GTA process is running
            if (args.Length > 0) // high iq arg handler
            {
                foreach (string arg in args)
                {
                    switch (arg)
                    {
                    case "/hide":     // start in systray
                        notifyIcon.Visible = true;
                        this.WindowState   = FormWindowState.Minimized;
                        this.Hide();
                        this.Visible       = false; // for some reason Hide() doesn't always work
                        this.ShowInTaskbar = false;
                        break;

                    default:
                        break;
                    }
                }
            }

            KeybindHandler.RegisterHotkeys(this);
            InitialiseBackgroundWorkers();

            balloonStatus = true;
        }
Пример #2
0
 private void MainWindow_FormClosed(object sender, FormClosedEventArgs e) // clean up after ourselves
 {
     KeybindHandler.UnregisterHotkeys(this);
 }