private void cmdRefresh_Click(object sender, EventArgs e) { listView1.Items.Clear(); proc = WindowPOS.GetWindowsInfo(); foreach (var item in proc) { listView1.Items.Add(new ListViewItem(new string[] { item.proc.ProcessName, item.rect.Left.ToString(), item.rect.Top.ToString(), item.rect.Right.ToString(), item.rect.Bottom.ToString() })); } }
public Form1() { InitializeComponent(); if (!IsUserAdministrator()) { MessageBox.Show("ERROR", "Please restart application as ADMINISTRATOR", MessageBoxButtons.OK, MessageBoxIcon.Error); } proc = WindowPOS.GetWindowsInfo(); foreach (var item in proc) { listView1.Items.Add(new ListViewItem(new string[] { item.proc.ProcessName, item.rect.Left.ToString(), item.rect.Top.ToString(), item.rect.Right.ToString(), item.rect.Bottom.ToString() })); } }
private void cmdRestore_Click(object sender, EventArgs e) { WindowPOS.RestoreWindowStates(); }
private void cmdSave_Click(object sender, EventArgs e) { WindowPOS.SaveWindowStates(WindowPOS.GetWindowsInfo(), listView1.SelectedIndices); }