Alex Broadwin
Alex Broadwin

Reputation: 1338

How to obtain a window handle for an IUIAutomationElement in HEX using UIA?

I'm looking for a way to obtain or create a text representation of the HWND of an IUIAutomationElement, but all I can find when I research it is:

1) How to obtain an opaque native handle

2) How to look up an element by native handle

Is my goal possible?

Thank you for your time, and for any assistance you can provide.

Upvotes: 2

Views: 2240

Answers (1)

Ronak Agrawal
Ronak Agrawal

Reputation: 1066

This is how it's done in C# Window handle automation element can be obtained by searching the element, then access the window handle by automationelement.Current.NativeWindowHandle. But that's a hex value. You can always do a ToString() for a string conversion

Upvotes: 2

Related Questions