private void ShowTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (alwaysShow) { return; } try { // only show the suspended window when tibia is active bool visible = GetActiveProcessFileName() == MainForm.GetTibiaProcess().ProcessName; this.Invoke((MethodInvoker) delegate { this.Visible = visible; }); } catch { } }