/// <summary> /// Create our hotkey on startup, initialize notifyicon /// TBI -- Customize hotkey combination via options right click /// </summary> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); notifyIcon = (TaskbarIcon)FindResource("NotifyIcon"); var _hotKey = new KeyboardHook(Key.Space,KeyModifier.Ctrl, OnHotKeyHandler); notifyIcon.ShowBalloonTip("Window Butler Started", "Press [CTRL] + [SPACE]", BalloonIcon.Info); }
private void OnHotKeyHandler(KeyboardHook obj) { if (Application.Current.MainWindow == null) { Application.Current.MainWindow = new UCButler(); Application.Current.MainWindow.Show(); } else { Application.Current.MainWindow.Activate(); } }