About AutomationInteropProvider.HostProviderFromHandle

 

It can return a provider from any window which has a handle, including not only top-level windows, but also normal controls such as buttons.

The following sample demonstrates that a provider is successfully returned from a button handle:

image

The output:

image

Leave a Reply