public ListViewItem ConvertToListViewItem(int index, TopLevelWindowInfo a) { var ss = new string[] { index.ToString(), a.hWnd.ToString("X8"), a.pid.ToString(), a.windowText, a.className, a.left.ToString(), a.top.ToString(), a.width.ToString(), a.height.ToString(), a.clientLeft.ToString(), a.clientTop.ToString(), a.clientWidth.ToString(), a.clientHeight.ToString(), a.windowStyle.ToString("X8") }; var t = new ListViewItem(ss); t.Tag = a; return(t); }
private void btnSelectWin_Click(object sender, EventArgs e) { WindowSelector dlg = new WindowSelector(); if (dlg.ShowDialog(this) == DialogResult.OK) { targetWindow = dlg.selectedWindow; txtTargetWindow.Text = String.Format("{0} - {1}", targetWindow.windowText, targetWindow.className); } dlg.Dispose(); }
private void btnSelect_Click(object sender, EventArgs e) { if (lsvWinList.SelectedItems.Count > 0) { int selectedIdx = Convert.ToInt32(lsvWinList.SelectedItems[0].Text, 10); if (wndInfos.Count >= selectedIdx) { selectedWindow = wndInfos[selectedIdx - 1]; this.DialogResult = DialogResult.OK; } } }