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