Thread: [Mwinapi-commits] SF.net SVN: mwinapi: [64] trunk/Tools/WinternalExplorer
Status: Beta
Brought to you by:
schierlm
From: <sch...@us...> - 2008-04-06 14:41:35
|
Revision: 64 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=64&view=rev Author: schierlm Date: 2008-04-06 07:41:30 -0700 (Sun, 06 Apr 2008) Log Message: ----------- Fix a crash when calling TreeNodeData.Equals with an instance of a different subclass as its parameter; reduce flickering when crosshair is dragged Modified Paths: -------------- trunk/Tools/WinternalExplorer/MainForm.cs trunk/Tools/WinternalExplorer/TreeNodeData.cs Property Changed: ---------------- trunk/Tools/WinternalExplorer/ Property changes on: trunk/Tools/WinternalExplorer ___________________________________________________________________ Name: svn:ignore - bin obj *.user + bin obj *.user WinternalExplorer.suo Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2008-03-29 13:45:40 UTC (rev 63) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2008-04-06 14:41:30 UTC (rev 64) @@ -215,11 +215,17 @@ this.Cursor = null; } + SelectableTreeNodeData lastNode = null; + private void UpdateSelection(bool includeTree) { SelectableTreeNodeData stnd = SelectFromPoint(lastX, lastY); if (!Visible) Visible = true; - DoSelect(stnd, includeTree); + if (!stnd.Equals(lastNode)) + { + DoSelect(stnd, includeTree); + lastNode = stnd; + } } private SelectableTreeNodeData SelectFromPoint(int lastX, int lastY) @@ -482,4 +488,4 @@ } } } -} \ No newline at end of file +} Modified: trunk/Tools/WinternalExplorer/TreeNodeData.cs =================================================================== --- trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-03-29 13:45:40 UTC (rev 63) +++ trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-04-06 14:41:30 UTC (rev 64) @@ -26,7 +26,7 @@ { if (obj == null || GetType() != obj.GetType()) return false; if (mf != ((TreeNodeData)obj).mf) return false; - return Equals((TreeNodeData)obj); + return EqualsInternal((TreeNodeData)obj); } public override int GetHashCode() @@ -34,7 +34,7 @@ return 42; } - public abstract bool Equals(TreeNodeData tnd); + protected abstract bool EqualsInternal(TreeNodeData tnd); } internal abstract class SelectableTreeNodeData : TreeNodeData @@ -90,7 +90,7 @@ get { return NoneControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return true; } @@ -198,7 +198,7 @@ get { return ProcessControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((ProcessData)tnd).process.Id == process.Id; } @@ -306,7 +306,7 @@ get { return ThreadControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((ThreadData)tnd).thread.Id.Equals(thread.Id); } @@ -411,7 +411,7 @@ get { return WindowControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((WindowData)tnd).sw.HWnd == sw.HWnd; } @@ -601,7 +601,7 @@ get { return AccessibilityControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((AccessibilityData)tnd).accobj.Equals(this.accobj); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <sch...@us...> - 2008-06-14 18:49:10
|
Revision: 71 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=71&view=rev Author: schierlm Date: 2008-06-14 11:49:09 -0700 (Sat, 14 Jun 2008) Log Message: ----------- WinternalExplorer: Add checkbox to disable heuristics when determining control from point (these heuristics fail for some MDI applications like Visual Studio) Modified Paths: -------------- trunk/Tools/WinternalExplorer/MainForm.Designer.cs trunk/Tools/WinternalExplorer/MainForm.cs Modified: trunk/Tools/WinternalExplorer/MainForm.Designer.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.Designer.cs 2008-06-14 18:29:56 UTC (rev 70) +++ trunk/Tools/WinternalExplorer/MainForm.Designer.cs 2008-06-14 18:49:09 UTC (rev 71) @@ -64,6 +64,7 @@ this.selChildWindows = new System.Windows.Forms.RadioButton(); this.selToplevel = new System.Windows.Forms.RadioButton(); this.crossHair = new ManagedWinapi.Crosshair(); + this.heuristicSearch = new System.Windows.Forms.CheckBox(); this.menuStrip1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -90,7 +91,7 @@ this.toolsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(592, 24); + this.menuStrip1.Size = new System.Drawing.Size(671, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // @@ -311,6 +312,7 @@ // // splitContainer1.Panel2 // + this.splitContainer1.Panel2.Controls.Add(this.heuristicSearch); this.splitContainer1.Panel2.Controls.Add(this.allowChanges); this.splitContainer1.Panel2.Controls.Add(this.autoHide); this.splitContainer1.Panel2.Controls.Add(this.details); @@ -319,7 +321,7 @@ this.splitContainer1.Panel2.Controls.Add(this.selToplevel); this.splitContainer1.Panel2.Controls.Add(this.crossHair); this.splitContainer1.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer1_Panel2_Paint); - this.splitContainer1.Size = new System.Drawing.Size(592, 349); + this.splitContainer1.Size = new System.Drawing.Size(671, 349); this.splitContainer1.SplitterDistance = 195; this.splitContainer1.TabIndex = 4; this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer1_SplitterMoved); @@ -352,7 +354,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.details.Location = new System.Drawing.Point(3, 45); this.details.Name = "details"; - this.details.Size = new System.Drawing.Size(390, 304); + this.details.Size = new System.Drawing.Size(469, 304); this.details.TabIndex = 5; this.details.TabStop = false; this.details.Text = "Details"; @@ -398,11 +400,23 @@ this.crossHair.CrosshairDragged += new System.EventHandler(this.crossHair_CrosshairDragged); this.crossHair.CrosshairDragging += new System.EventHandler(this.crossHair_CrosshairDragging); // + // heuristicSearch + // + this.heuristicSearch.AutoSize = true; + this.heuristicSearch.Checked = true; + this.heuristicSearch.CheckState = System.Windows.Forms.CheckState.Checked; + this.heuristicSearch.Location = new System.Drawing.Point(308, 22); + this.heuristicSearch.Name = "heuristicSearch"; + this.heuristicSearch.Size = new System.Drawing.Size(138, 17); + this.heuristicSearch.TabIndex = 8; + this.heuristicSearch.Text = "Heuristic Control search"; + this.heuristicSearch.UseVisualStyleBackColor = true; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(592, 373); + this.ClientSize = new System.Drawing.Size(671, 373); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -457,6 +471,7 @@ private System.Windows.Forms.ToolStripMenuItem stolenOrphanWindowsToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripMenuItem visibleObjectsOnlyToolStripMenuItem; + private System.Windows.Forms.CheckBox heuristicSearch; } } Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2008-06-14 18:29:56 UTC (rev 70) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2008-06-14 18:49:09 UTC (rev 71) @@ -247,6 +247,8 @@ else { SystemWindow sw = SystemWindow.FromPointEx(lastX, lastY, selToplevel.Checked, false); + if (!heuristicSearch.Checked && !selToplevel.Checked) + sw = SystemWindow.FromPoint(lastX, lastY); if (sw != highlightedWindow) { if (highlightedWindow != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |