def event_liveRegionChange(self, obj, nextHandler):
if isinstance(obj, UIA) and obj.UIAElement.cachedAutomationID == "_progressText":
if obj.name != self._appInstallProgress:
self._appInstallProgress = obj.name
# Don't forget to announce product title.
productTitle = obj.parent.previous
# Since March 2017 update, it is no longer the product name, but a progress button.
if productTitle and productTitle.role == controlTypes.ROLE_BUTTON:
# But since September 2017 update, the title is next door.
possibleProductTitle = productTitle.parent.previous
productTitle = productTitle.previous if possibleProductTitle is None else productTitle.parent.previous
if productTitle and isinstance(productTitle, UIA) and productTitle.UIAElement.cachedAutomationID == "_productTitle":
ui.message(" ".join([productTitle.name, obj.name]))
return
nextHandler()
评论列表
文章目录