private void btnQuery_MouseClick(object sender, MouseEventArgs e) { IntPtrNodeViewItem intPtrNodeViewItem = ctQueryList.SelectedNode as IntPtrNodeViewItem; if (intPtrNodeViewItem == null) { return; } // this.nodeViewItemTree1.NodeViewItems.Clear(); // System.Text.StringBuilder sbClassName = new StringBuilder(255); GISShare.Win32.API.GetClassName(intPtrNodeViewItem.IntPtrInfo, sbClassName, 255); // System.Text.StringBuilder strWindowsText = new StringBuilder(255); GISShare.Win32.API.GetWindowText(intPtrNodeViewItem.IntPtrInfo, strWindowsText, 255); this.FilterWindowsText(strWindowsText); // GISShare.Controls.WinForm.WFNew.View.NodeViewItem node = new GISShare.Controls.WinForm.WFNew.View.NodeViewItem(); node.Name = intPtrNodeViewItem.IntPtrInfo.ToString(); node.Text = intPtrNodeViewItem.Text + " ¡ª ¡¾´°¿Ú¾ä±ú[HWND]£º" + intPtrNodeViewItem.IntPtrInfo.ToInt32() + "¡¿ ¡ª ÀàÃû³Æ[ClassName]£º{" + sbClassName.ToString() + "} ¡ª ´°¿ÚÎı¾[WindowText]£º" + strWindowsText; node.IsExpanded = true; this.nodeViewItemTree1.NodeViewItems.Add(node); // GISShare.Win32.API.EnumChildWindows(intPtrNodeViewItem.IntPtrInfo, EnumCP, intPtrNodeViewItem.IntPtrInfo); // this.lblInfo.Text = "¹²Ð¯´ø " + node.NodeViewItems.Count + " ¾ä±ú"; this.toolBarN2.Refresh(); }
private void AddQueryWindows_DG(Control control, WFNew.View.NodeViewItemCollection nodes) { for (int i = 0; i < control.Controls.Count; i++) { Control ctr = control.Controls[i]; IntPtrNodeViewItem node = new IntPtrNodeViewItem(ctr.Name, this.FilterWindowsText(ctr.Text), ctr.Handle); //node.IsExpanded = true; nodes.Add(node); // this.AddQueryWindows_DG(ctr, node.NodeViewItems); } }
public void AddQueryWindows(Control control) { IntPtrNodeViewItem intPtrNodeViewItem = new IntPtrNodeViewItem(control.Name, this.FilterWindowsText(control.Text), control.Handle); intPtrNodeViewItem.IsExpanded = true; this.ctQueryList.NodeViewItems.Add(intPtrNodeViewItem); // for (int i = 0; i < control.Controls.Count; i++) { Control ctr = control.Controls[i]; IntPtrNodeViewItem node = new IntPtrNodeViewItem(ctr.Name, this.FilterWindowsText(ctr.Text), ctr.Handle); node.IsExpanded = true; intPtrNodeViewItem.NodeViewItems.Add(node); // this.AddQueryWindows_DG(ctr, node.NodeViewItems); } // this.ctQueryList.SelectedNode = intPtrNodeViewItem; }