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); }
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); }