Example #1
0
        public MainForm()
        {
            InitializeComponent();
            AllowTransparency = true;
            presenter = new MainFormPresenter(this, new JediSettings());

            mouseHook = new MouseHook();
            mouseHook.MouseEvent += MouseHookMouseEvent;
            keyboardHook = new KeyboardHook();
            keyboardHook.KeyboardEvent += KeyboardHookKeyboardEvent;
            mgr.ShortcutActivated += mgr_OnShortcutActivated;
            keyboardHook.InstallHook();
        }
Example #2
0
        private void MainFormFormClosing(object sender, FormClosingEventArgs e)
        {
            Settings.Default["Opacity"] = Opacity;
            Settings.Default.Save();
            Settings.Default.Upgrade();

            if (mouseHook != null)
            {
                mouseHook.Dispose();
                mouseHook = null;
            }
            if (keyboardHook != null)
            {
                keyboardHook.Dispose();
                keyboardHook = null;
            }
        }