投稿者 魔界の仮面弁士  (社会人) 投稿日時 2023/1/3 10:17:09
Excel VBA の UserForm 上に、 UIAutomation の TreeWalker での列挙内容を
エクスプローラーのように TreeView + ListView で表現するサンプルを書いてみました。
https://gist.github.com/Benshi/be84f9a9ea2f467b43703f9e8e409f1d


> そこで再度、Edgeから、ClassNameで、追いかけると
上記の VBA 版だと拾えているようです。TreeWalker は試されましたか?

⊟[Window]"Chrome_WidgetWin_1"
 ┣⊡[Pane]"Intermediate D3D Window"
 ┣⊡[Pane]"Intermediate D3D Window"
 ┗⊟[Pane]"BrowserRootView"
   ┣⊟[Pane]"NonClientView"
   ┃ ┣⊟[Pane]"GlassBrowserFrameView"
   ┃ ┃ ┣⊡[Pane]"InkDropContainerView"
   ┃ ┃ ┣⊡[Text]"Label"
   ┃ ┃ ┣⊞[Pane]"GlassBrowserCaptionButtonContainer"
   ┃ ┃ ┗⊟[Pane]"BrowserView"
   ┃ ┃   ┣⊞[Pane]"TopContainerView"
   ┃ ┃   ┣⊞[Pane]"EdgeHubAppsTowerView"
   ┃ ┃   ┣⊟[Pane]"SidebarContentsSplitView"
   ┃ ┃   ┃ ┣⊟[Pane]"SidebarContentsSplitView"
   ┃ ┃   ┃ ┃ ┣⊟[Pane]"SidebarContentsSplitView"
   ┃ ┃   ┃ ┃ ┃ ┣⊟[Pane]"SidebarContentsSplitView"
   ┃ ┃   ┃ ┃ ┃ ┃ ┣⊞[Group]"InfoBarContainerView"
   ┃ ┃   ┃ ┃ ┃ ┃ ┣⊡[Pane]"AccessiblePaneView"
   ┃ ┃   ┃ ┃ ┃ ┃ ┣⊞[Pane]"View" ← ★今回の問題の View
   ┃ ┃   ┃ ┃ ┃ ┃ ┃ ┣⊟[Document]"WebView"
   ┃ ┃   ┃ ┃ ┃ ┃ ┃ ┃ ┗⊡[Pane]"NativeViewHost"
   ┃ ┃   ┃ ┃ ┃ ┃ ┃ ┗⊞[Pane]"Chrome_RenderWidgetHostHWND"
   ┃ ┃   ┃ ┃ ┃ ┃ ┃   ┗⊞[Document]"" ← Name = "Visual Basic 中学校"
   ┃ ┃   ┃ ┃ ┃ ┃ ┗⊞[Pane]"ReactiveSearchView"
   ┃ ┃   ┃ ┃ ┃ ┗⊞[Pane]"SidePaneRootContainer"
   ┃ ┃   ┃ ┃ ┗⊞[Pane]"SidePaneRootContainer"
   ┃ ┃   ┃ ┗⊞[Pane]"SidePaneRootContainer"
   ┃ ┃   ┣⊞[Tab]"EdgeVertialTabContainerView"
   ┃ ┃   ┣⊡[Pane]"View"
   ┃ ┃   ┗⊡[Pane]"View"
   ┃ ┗⊡[Pane]"TopContainerOverlayView"
   ┗⊡[Text]"AnnounceTextView"