Microsoft Edge: Get Window URL and Title

后端 未结 7 1132
滥情空心
滥情空心 2020-12-06 15:33

Previously I was using ShellWindows() API for IE to get the window Title and URL for my application Now with new development, Microsoft Edge is new and has many features und

7条回答
  •  春和景丽
    2020-12-06 16:00

    I have tried Guy Barker above code in Windows 10 Professional machine, its working great.

    If I have tried the same code in Windows 10 Home Edition(upgraded from windows 8.1) machine, its not working and the"urlElement" return null for me. The code not find the Internet Explorer_Server class. But the Internet Explorer_Server class has found while navigate using inspect.exe.

    IUIAutomationElement urlElement =
            edgeElement.FindFirstBuildCache(
                TreeScope.TreeScope_Descendants,
                conditionUrl,
                cacheRequest);
    
    if(urlElement == null)//true
    

    I have explore further, the code not capture pane(Spartan XAML-To-Trident Input Routing Window) node in windows 10 Home edition machine. So i could not reach "Internet Explorer_Server" class to find URL.

    Is any difference between home and professional edition OS? How to solve it?

    Thanks

    Satheesh

提交回复
热议问题