private void UpdateWindowTreeProc(object param) { IntPtr tagWindow = (IntPtr)param; if (tagWindow != IntPtr.Zero) { this.UpdateControlState(false); WindowTreeBuilder builder = new WindowTreeBuilder(tagWindow); builder.BuildAllWindowsTree(); this.SetWindowTreeNodeImage(this.WindowTreeImageList, builder.RootNode); this.UpdateWindowTree(builder); this.UpdateControlState(true); } }
private void UpdateWindowTree(WindowTreeBuilder builder) { if (this.InvokeRequired) { this.BeginInvoke(new UpdateWindowTreeInvoker(this.UpdateWindowTree), new object[] { builder }); } else { if (this.IsHandleCreated) builder.RemoveWindow(this.Handle); //if (this.tsbDotNetOnly.Checked) builder.FilterUnmanagedWindows(); builder.FilterUnmanagedWindows(); this.tvWindowTree.BeginUpdate(); this.tvWindowTree.ImageList = this.WindowTreeImageList; this.tvWindowTree.Nodes.Add(builder.RootNode); this.tvWindowTree.SelectedNode = builder.RootNode; this.tvWindowTree.EndUpdate(); } }