private void WarframeIsRunning(Process warframe) { try { warframeProcess = warframe; warframeProcess.Exited += new EventHandler(TargetProcess_Exited); warframeProcess.EnableRaisingEvents = true; queryHandler = new WarframeQueryHandler(); processDetector = null; if (this.InvokeRequired) //Registers the hotkey { this.Invoke(new MethodInvoker(delegate { RegisterTriggerKey(Properties.Settings.Default.Key_Value, Properties.Settings.Default.Modifier_Value); })); } else { RegisterTriggerKey(Properties.Settings.Default.Key_Value, Properties.Settings.Default.Modifier_Value); } trayIcon.SetTextSuccess(); } catch (NullReferenceException e) { MessageBox.Show(e.Message, "Process Assignment Error"); this.Close(); } } //called if Warframe has been detected
public GlobalHotkeyListener() { InitializeComponent(); this.WindowState = FormWindowState.Minimized; this.Hide(); //Makes it not show up on taskbar this.TopLevel = false; //Makes it not show up under Apps in Task Manager trayIcon = null; //Shows the system tray icon processDetector = null; queryHandler = null; warframeProcess = null; mainTrigger = null; }