Example #1
0
        public static void Main(string[] args)
        {
            var config = QcmdConfig.Create("config.json");

            if (config == null)
            {
                throw new Exception("Config null - create a config.json file");
            }

            var form = new QCmdHostForm(config);

            Application.Run(form);
        }
Example #2
0
        public QCmdHostForm(QcmdConfig config)
        {
            _config = config;

            InitializeComponent();

            _hook = new KeyboardHook();
            _hook.KeyPressed += KeyPressed;

            _hook.RegisterHotKey(KeyboardHook.ModifierKeys.Win, Keys.Q);
            _hook.RegisterHotKey(KeyboardHook.ModifierKeys.Control | KeyboardHook.ModifierKeys.Alt, Keys.NumPad8);

            _browser = new BrowserWrapper(config.StartPage);
            _browser.HideCallback = ThreadedHide;
            Controls.Add(_browser.Control);

            Closed += (o, s) => CefSharp.Cef.Shutdown();

            CenterToScreen();
            Location = new Point(Location.X, 0);
        }
Example #3
0
        public QCmdHostForm(QcmdConfig config)
        {
            _config = config;

            InitializeComponent();

            _hook             = new KeyboardHook();
            _hook.KeyPressed += KeyPressed;

            _hook.RegisterHotKey(KeyboardHook.ModifierKeys.Win, Keys.Q);
            _hook.RegisterHotKey(KeyboardHook.ModifierKeys.Control | KeyboardHook.ModifierKeys.Alt, Keys.NumPad8);

            _browser = new BrowserWrapper(config.StartPage);
            _browser.HideCallback = ThreadedHide;
            Controls.Add(_browser.Control);

            Closed += (o, s) => CefSharp.Cef.Shutdown();

            CenterToScreen();
            Location = new Point(Location.X, 0);
        }