Just looking for a pointer as I'm struggling to find material online...
Is there a library or reference I can use in VB.NET to assign an arbitrary open window to an object via its handle, such that I can then view the elements & attributes associated with that window? I can identify the handle via Process.MainWindowHandle
(i.e. System.Diagnostics.Process.GetProcesses
) but how can I then use that handle to "hook" onto the window as an object?
(FYI The window is independent of my application, it's not a form or anything like that - it's just an open window)
All the material I find online is telling me how to get the handle but that's not the issue; I have the handle but I don't know how to use it to "hook" onto the window programmatically?
Would appreciate any pointers anyone could provide!
Thanks
Al
Here is the solution I arrived at, which is working exactly as intended. Cannot claim credit for it as @Jimi gave me all the necessary pointers for me to arrive at this. However, the snippet may be helpful for others trying to navigate UI Automation for the first time, like I was.