Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 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;
         }
     }
 }