private void addSelectedItem_Click(object sender, EventArgs e)
{
/*
Rectangle rect = new Rectangle(0, 0, 0, 0);
if (true)
{
rect = Screen.PrimaryScreen.Bounds;
}
else
{
foreach (Screen screen in Screen.AllScreens)
rect = Tools.GetContainingRectangle(rect, screen.Bounds);
}
Form frm = new Form();
frm.Text = "Borderless Gaming Background";
frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
frm.BackColor = Color.Black;
frm.Show();
frm.Location = new Point(rect.X, rect.Y);
frm.Size = new System.Drawing.Size(rect.Width, rect.Height);
frm.DoubleClick += (Fs, Fe) => { try { ((Form)(Fs)).Close(); } catch { } };
//frm.Shown += (Fs, Fe) => { Cursor.Hide(); };
//frm.FormClosing += (Fs, Fe) => { Cursor.Show(); };
return;
*/
// assume that the button press to add to favorites will do so by window title (unless it's blank, then go by process name)
if (this.lstProcesses.SelectedItem == null) return;
ProcessDetails pd = ((ProcessDetails)this.lstProcesses.SelectedItem);
if (!pd.Manageable)
return;
if (!string.IsNullOrEmpty(pd.WindowTitle))
this.byTheWindowTitleTextToolStripMenuItem_Click(sender, e);
else
this.byTheProcessBinaryNameToolStripMenuItem_Click(sender, e);
}