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