Trying to read URL from Edge, Process.MainWindowHandle = 0 for "MicrsoftEdge.exe" Process

418 Views Asked by At

I'm trying to write an Edge -> Chrome service, so i'm using a ManagementEventWatcher to create an "edge started" event.

From the event i get the processId, from the processId i get the Process, and from the process i get the Main window handle.

What's annoying is, when i set the event watcher to watch for MicrosoftEdgeCP, i get a main window handle, when i set it to MicrosoftEdge i get nothing.

I tried to navigate the MicrosoftEdgeCPs using AutomationElement (thinking i may be able to pull the url from that), but when i use .FindAll(TreeScope.Children, Condition.TrueCondition) i get zero children.

So i'm calling it a night for now, any suggestions would be warmly appreciated :)

0

There are 0 best solutions below