コード例 #1
0
 private void GlobalHotkeyListener_Load(object sender, EventArgs e)
 {//Checks if warframe is running, if not, adds watchers
     try
     {
         trayIcon = new SystemTrayIcon(this);
         trayIcon.Initialize();
         processDetector = new ProcessDetector(new string[] { "Notepad", "Notepad.x64" }, WarframeIsRunning);
         processDetector.Start();
     }
     catch (SystemTrayIconException a)
     {
         string temp = a.Message;
         if (a.InnerException != null)
         {
             temp += "\nInner Message: " + a.InnerException.Message;
         }
         MessageBox.Show(this, temp, "System Tray Icon Error");
         this.Close();
     }
     catch (ProcessDetectorException a)
     {
         string temp = a.Message;
         if (a.InnerException != null)
         {
             temp += "\nInner Message: " + a.InnerException.Message;
         }
         MessageBox.Show(this, temp, "Process Detector Error");
         this.Close();
     }
 }