-
Notifications
You must be signed in to change notification settings - Fork 32
11. Differences from original UIA
This library is not a direct wrapper for the UIAutomation framework by Microsoft, but instead in some ways re-imagines and simplifies it. It also differs from thqby's original UIAutomation library for AHK v2, which closely follows Microsoft's implementation.
Instead of needing to use UIA condition-creation functions such as UIA.CreatePropertyCondition
, this library implements condition objects that get converted to IUIAutomationCondition objects either by search methods or with UIA.CreateCondition
. Read more about the syntax of these condition objects from the Conditions section of this Wiki. These objects are automatically detected by most commonly used methods such as FindElement, FindFirst, and CreateTreeWalker. IUIAutomationConditions can also be fed into the same methods.
For all BuildCache methods, the first argument is usually the cacheRequest. Instead of the original IUIAutomationElement::FindFirstBuildCache(scope, condition, cacheRequest
, we now have Element.FindFirstBuildCache(cacheRequest, condition, scope)
.
Some custom methods additionally have the optional cacheRequest argument, in this case it's usually the last one (or one of the last ones). Example: Element.FindElement(condition, scope:=4, startingElement:=0, traversalOptions:=0, cacheRequest:=0)
.
The TreeScope argument (scope) has usually been pushed backwards in the order, because it rarely needs to be changed from the default Descendants. This means instead of IUIAutomationElement7::FindFirstWithOptions(scope, condition, traversalOptions, root)
we have Element.FindFirstWithOptions(condition, traversalOptions:=0, root:=0, scope:=4, cacheRequest:=0)
.
An exception to this is FindElement(s), because it's a combination of multiple different Find methods and thus must support different versions of Windows where FindFirstWithOptions might not be supported.
In all methods involving events with a handler object, the handler is the first argument. Eg UIA.AddAutomationEventHandler(handler, *)