[Mwinapi-commits] SF.net SVN: mwinapi: [70] trunk/Tools/WinternalExplorer
Status: Beta
Brought to you by:
schierlm
From: <sch...@us...> - 2008-06-14 18:29:57
|
Revision: 70 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=70&view=rev Author: schierlm Date: 2008-06-14 11:29:56 -0700 (Sat, 14 Jun 2008) Log Message: ----------- WinternalExplorer: * Fix refresh of tree when releasing Crosshair * Fix PossibleParents so that windows that are children of a window of a different process (most prominent example: screensaver preview in control panel) can be found in tree. Modified Paths: -------------- trunk/Tools/WinternalExplorer/MainForm.cs trunk/Tools/WinternalExplorer/TreeNodeData.cs Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2008-05-01 20:24:28 UTC (rev 69) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2008-06-14 18:29:56 UTC (rev 70) @@ -212,28 +212,30 @@ lastX = MousePosition.X; lastY = MousePosition.Y; UpdateSelection(true); - if (highlightedWindow != null) - { - highlightedWindow.Refresh(); - highlightedWindow = null; - } + if (highlightedWindow != null) + { + highlightedWindow.Refresh(); + highlightedWindow = null; + } this.Cursor = null; } SelectableTreeNodeData lastNode = null; + bool lastIncludeTree = false; private void UpdateSelection(bool includeTree) { SelectableTreeNodeData stnd = SelectFromPoint(lastX, lastY); if (!Visible) Visible = true; - if (!stnd.Equals(lastNode)) + if (!stnd.Equals(lastNode) || includeTree != lastIncludeTree) { DoSelect(stnd, includeTree); lastNode = stnd; + lastIncludeTree = includeTree; } } - SystemWindow highlightedWindow; + SystemWindow highlightedWindow; private SelectableTreeNodeData SelectFromPoint(int lastX, int lastY) { @@ -245,19 +247,19 @@ else { SystemWindow sw = SystemWindow.FromPointEx(lastX, lastY, selToplevel.Checked, false); - if (sw != highlightedWindow) - { - if (highlightedWindow != null) - { - highlightedWindow.Refresh(); - highlightedWindow = null; - } - if (sw.HWnd != this.Handle && !sw.IsDescendantOf(new SystemWindow(this.Handle))) - { - sw.Highlight(); - highlightedWindow = sw; - } - } + if (sw != highlightedWindow) + { + if (highlightedWindow != null) + { + highlightedWindow.Refresh(); + highlightedWindow = null; + } + if (sw.HWnd != this.Handle && !sw.IsDescendantOf(new SystemWindow(this.Handle))) + { + sw.Highlight(); + highlightedWindow = sw; + } + } return new WindowData(this, sw); } } Modified: trunk/Tools/WinternalExplorer/TreeNodeData.cs =================================================================== --- trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-05-01 20:24:28 UTC (rev 69) +++ trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-06-14 18:29:56 UTC (rev 70) @@ -330,13 +330,15 @@ { List<TreeNodeData> result = new List<TreeNodeData>(); SystemWindow curr = sw; + SystemWindow last = curr; while (curr != null) { result.Add(new WindowData(mf, curr)); + last = curr; curr = curr.ParentSymmetric; } - result.Add(new ThreadData(mf, sw.Process, sw.Thread)); - result.Add(new ProcessData(mf, sw.Process)); + result.Add(new ThreadData(mf, last.Process, last.Thread)); + result.Add(new ProcessData(mf, last.Process)); return result; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |