控件框面板完成:树重读后按 Path 重新绑定当前节点

- SetActiveNode/ApplyFilter 时把 _currentNode/_currentPath 换成当前快照里的新节点对象:
  实时刷新会重建节点(旧的 N 会换成新的 S),否则父子关系表以新对象为键会查不到,
  父节点/上一个/下一个在树刷新后就失效
- 代码导览补上控件框面板与空树自动开无障碍的说明

实测(独立宿主 + 跨进程读夹具树):41 个节点全部出框;面板按钮
【点击框获取path / 退出绘制 / 父节点 / 上一个 / 下一个 / 复制当前框 Path】齐备;
把列表行设为当前框后,整条祖先链(Tab→TabItem→Pane→列表→行)高亮成橙色、
其余框变淡、当前框带标签;RefreshMap / HideMap 后状态正确

回归 29/29 通过
This commit is contained in:
zimoyin
2026-10-13 19:30:54 +08:00
parent 170790ff12
commit c1e2bd29a1
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -50,6 +50,7 @@ MainForm(UI/MainForm.cs) 三栏主界面:窗口列表 | 控件树/列
| 控件树怎么显示、要不要闪烁 | `UI/ControlTreeReconciler.cs` | 增量更新,绝不清空重建 | | 控件树怎么显示、要不要闪烁 | `UI/ControlTreeReconciler.cs` | 增量更新,绝不清空重建 |
| 拾取为什么选到容器 | `Services/UiAutomationService.cs` 的 `FromHandleAtPoint` | 命中后向深处收敛 | | 拾取为什么选到容器 | `Services/UiAutomationService.cs` 的 `FromHandleAtPoint` | 命中后向深处收敛 |
| 拾取的蓝框/黄框(层级) | `Services/TargetProbeService.cs`(FillHierarchyFrames)+ `UI/PickHierarchyOverlayForm.cs` | 蓝=光标所在窗口,黄=向上遍历的控件链 | | 拾取的蓝框/黄框(层级) | `Services/TargetProbeService.cs`(FillHierarchyFrames)+ `UI/PickHierarchyOverlayForm.cs` | 蓝=光标所在窗口,黄=向上遍历的控件链 |
| 空树自动开无障碍 | `Services/ControlTreeService.cs` | 读到空树/只有边框/渲染区域为空时自动请求开启无障碍并重读(设置里可关) |
| 控件树读取来源与顺序 | `Services/ControlTreeService.cs` | Auto = UIA → MSAA → Win32 | | 控件树读取来源与顺序 | `Services/ControlTreeService.cs` | Auto = UIA → MSAA → Win32 |
| UIA 快照/缓存/Pattern | `Services/UiAutomationService.cs` | 统一 RawView + CacheRequest | | UIA 快照/缓存/Pattern | `Services/UiAutomationService.cs` | 统一 RawView + CacheRequest |
| 列表读取(行列/单元格/降级) | `Services/ListReaderService.cs` | 最长的文件,见其顶部导览 | | 列表读取(行列/单元格/降级) | `Services/ListReaderService.cs` | 最长的文件,见其顶部导览 |
@@ -65,7 +66,7 @@ MainForm(UI/MainForm.cs) 三栏主界面:窗口列表 | 控件树/列
| 悬浮条外观(自绘/透明) | `UI/FloatingToolbarForm.cs` | layered window,注意 GDI 释放 | | 悬浮条外观(自绘/透明) | `UI/FloatingToolbarForm.cs` | layered window,注意 GDI 释放 |
| 遮挡/可见性判断 | `Services/WindowVisibility.cs` | 两个 API 用途不同,见文件头 | | 遮挡/可见性判断 | `Services/WindowVisibility.cs` | 两个 API 用途不同,见文件头 |
| 高亮框/跟随 | `Services/HighlightFollower.cs` | 跟随锚点窗口的相对偏移 | | 高亮框/跟随 | `Services/HighlightFollower.cs` | 跟随锚点窗口的相对偏移 |
| 全部控件框绘制 / 侧边按钮与过滤 | `UI/NodeMapOverlayForm.cs` | 只在前台窗口且未遮挡处绘制;点框即选中控件树节点并刷新控件属性 | | 全部控件框绘制 / 侧边面板 | `UI/NodeMapOverlayForm.cs` | 只在前台窗口且未遮挡处绘制;点框即选中控件树节点并刷新控件属性;右侧面板有 父节点/上一个/下一个(并高亮整条祖先链)、复制 Path、搜索与类型过滤、"仅选中及其祖先/后代"、显示标签开关;标签只画在鼠标下的那个框上 |
| 拾取器 | `Picker/CrosshairPicker.cs` + `UI/PickerOverlayForm.cs` | 不抢焦点、吞左键 | | 拾取器 | `Picker/CrosshairPicker.cs` + `UI/PickerOverlayForm.cs` | 不抢焦点、吞左键 |
| 单实例/转发 | `Services/SingleInstanceService.cs` + `Program.cs` | Mutex + 命名管道 | | 单实例/转发 | `Services/SingleInstanceService.cs` + `Program.cs` | Mutex + 命名管道 |
| 无界面读取 | `Services/HeadlessConfigReader.cs` | 每条独立计时,统计口径在文件头 | | 无界面读取 | `Services/HeadlessConfigReader.cs` | 每条独立计时,统计口径在文件头 |
+12
View File
@@ -391,6 +391,11 @@ namespace pacs_win_uia.UI
_currentEntry = node != null && _entryByNode.TryGetValue(node, out found) ? found : null; _currentEntry = node != null && _entryByNode.TryGetValue(node, out found) ? found : null;
if (_currentEntry == null && !string.IsNullOrEmpty(path)) if (_currentEntry == null && !string.IsNullOrEmpty(path))
_currentEntry = FindEntryByPath(path); _currentEntry = FindEntryByPath(path);
if (_currentEntry != null)
{
_currentNode = _currentEntry.Item.Node;
_currentPath = _currentEntry.Item.Path;
}
ApplyFilter(); ApplyFilter();
UpdatePanelInfo(_currentEntry); UpdatePanelInfo(_currentEntry);
Invalidate(); Invalidate();
@@ -549,6 +554,13 @@ namespace pacs_win_uia.UI
Entry found; Entry found;
_currentEntry = _currentNode != null && _entryByNode.TryGetValue(_currentNode, out found) ? found : null; _currentEntry = _currentNode != null && _entryByNode.TryGetValue(_currentNode, out found) ? found : null;
if (_currentEntry == null && !string.IsNullOrEmpty(_currentPath)) _currentEntry = FindEntryByPath(_currentPath); if (_currentEntry == null && !string.IsNullOrEmpty(_currentPath)) _currentEntry = FindEntryByPath(_currentPath);
if (_currentEntry != null)
{
// 树重读后节点对象通常是新的:按 Path 命中时把引用换成本快照里的新对象,
// 否则后面的父子关系(_parentOf 以新对象为键)会查不到。
_currentNode = _currentEntry.Item.Node;
_currentPath = _currentEntry.Item.Path;
}
RebuildChain(); RebuildChain();
} }