Read MS Edge tabnames using C#

SamuliL 21 Reputation points
2020-08-20T12:23:25.42+00:00

Hello ya all!
Is it possible to read tabs opened into MS Edge browser from .NET MS Forms application?
My app export data to PDF-file (using DevExpress) and I need to check if the file is already open before accessing the file.

Using FileInfo.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)) does not recognize if the file is opened to edge. Exception is raised if it is opened some other pdf program.

Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2020-08-20T13:03:49.107+00:00

    You can enumerate Tabs with IUIAutomation (UIA_TabItemControlTypeId)
    Add reference to : c:\Windows\system32\UIAutomationCore.dll
    IUIAutomation.ElementFromHandle from the main Edge window handle, then you can enumerate children
    Use Inspect tool from MS SDK to check the hierarchy of controls


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.