Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

Is it OK to use multiple threads to work with UI Automation Client API?

$
0
0

UI Automation documentation recommends to "make all UI Automation calls from a separate thread" (seehttp://msdn.microsoft.com/en-us/library/ee671692%28v=VS.85%29.aspx)

However it says nothing about whether it should be the only thread or multi-threaded access is also possible and safe.

So, I have 3 questions:

1. Is it OK to access UI Automation API from multiple threads? Can I for example get a IUIAutomationElement in one thread and pass it to another thread for further usage?

2. Is it OK to access UI Automation from STA threads as longs as they do not attempt to add/remove event handlers? MSDN says "Using the Single-threaded Apartment (STA) model can cause problems such as preventing clients from removing event handlers from the thread.". Does this mean other uses of STA threads are OK?

3. If the above usage is safe which cases result in performance penalty?

Thanks.


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>