Topics

How to detect the creation of a UI object?

Cyrille
 

Hello

I would like to be able to detect the creation of a button. Is there an associated event? How to know it? And how to let NVDA listen to this event?

Detailed context:
In Outlook 2016, when you type an e-mail address in the "To" field, an alert message is displayed if an auto-reply has been configured for this e-mail address on the Exchange server.
I would like to alert the NVDA user when this alert pops up. This alert contains a button that allows to remove the corresponding e-mail address from the "To" field.

What I have tried:
I have tried to subclass this button and to define event_NVDAObject_init. However, it seems that NVDAObjects are created only when NVDA needs it (object getting focus, navigator object, etc.). The NVDAObject is not created as soon as the object occurs.

Questions:
how to be informed that this button has been created in the UI? Does NVDA need to subscribe to an event in an accessibility API? If yes, how to do this?

Below is the dev info when I press NVDA+F1 on this button
Developer info for navigator object:
name: u'DUPONT Jean 12345'
role: ROLE_BUTTON
states: STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <appModules.outlook.UIARecipientButton object at 0x0DCE17B0>
Python class mro: (<class 'appModules.outlook.UIARecipientButton'>, <class 'NVDAObjects.UIA.UIA'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: u"\ufeff \r\n\r\nThis is an out-of-office message. Supprimer le destinataire\xa0: Jean DUPONT 12345"
location: RectLTWH(left=67, top=221, width=143, height=20)
value: None
appModule: <'outlook' (appName u'outlook', process ID 2812) at address aa58870>
appModule.productName: u'Microsoft Outlook'
appModule.productVersion: u'16.0.4900.1000'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 3278568
windowClassName: u'NetUIHWND'
windowControlID: 0
windowStyle: 1442840576
extendedWindowStyle: 0
windowThreadID: 1892
windowText: u''
displayText: u''
UIAElement: <POINTER(IUIAutomationElement) ptr=0xa42ac00 at dae7da0>
UIA automationID: RecipientButton
UIA frameworkID:
UIA runtimeID: (42, 3278568, 3, -1265467264, 0)
UIA providerDescription: [pid:2812,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:mso40uiwin32client.dll)]
UIA className: NetUISimpleButton
UIA patterns available: LegacyIAccessiblePattern, InvokePattern, ScrollItemPattern

Any idea is welcome. Thanks in advance.
Kind regards,

Cyrille

derek riemer
 

you may need to check out eventHandler.registerEvents. There are some events we hide creation of, because otherwise, you'll get spammed with events and that can be expensive to handle. Also, uia does interesting things, and this is always difficult. is NVDA ever showing the alert? If you can object nav to it and look, you might be able to know more.

On Fri, Nov 22, 2019 at 2:04 AM Cyrille via Groups.Io <cyrille.bougot2=laposte.net@groups.io> wrote:
Hello

I would like to be able to detect the creation of a button. Is there an associated event? How to know it? And how to let NVDA listen to this event?

Detailed context:
In Outlook 2016, when you type an e-mail address in the "To" field, an alert message is displayed if an auto-reply has been configured for this e-mail address on the Exchange server.
I would like to alert the NVDA user when this alert pops up. This alert contains a button that allows to remove the corresponding e-mail address from the "To" field.

What I have tried:
I have tried to subclass this button and to define event_NVDAObject_init. However, it seems that NVDAObjects are created only when NVDA needs it (object getting focus, navigator object, etc.). The NVDAObject is not created as soon as the object occurs.

Questions:
how to be informed that this button has been created in the UI? Does NVDA need to subscribe to an event in an accessibility API? If yes, how to do this?

Below is the dev info when I press NVDA+F1 on this button
Developer info for navigator object:
name: u'DUPONT Jean 12345'
role: ROLE_BUTTON
states: STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <appModules.outlook.UIARecipientButton object at 0x0DCE17B0>
Python class mro: (<class 'appModules.outlook.UIARecipientButton'>, <class 'NVDAObjects.UIA.UIA'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: u"\ufeff \r\n\r\nThis is an out-of-office message. Supprimer le destinataire\xa0: Jean DUPONT 12345"
location: RectLTWH(left=67, top=221, width=143, height=20)
value: None
appModule: <'outlook' (appName u'outlook', process ID 2812) at address aa58870>
appModule.productName: u'Microsoft Outlook'
appModule.productVersion: u'16.0.4900.1000'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 3278568
windowClassName: u'NetUIHWND'
windowControlID: 0
windowStyle: 1442840576
extendedWindowStyle: 0
windowThreadID: 1892
windowText: u''
displayText: u''
UIAElement: <POINTER(IUIAutomationElement) ptr=0xa42ac00 at dae7da0>
UIA automationID: RecipientButton
UIA frameworkID:
UIA runtimeID: (42, 3278568, 3, -1265467264, 0)
UIA providerDescription: [pid:2812,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:mso40uiwin32client.dll)]
UIA className: NetUISimpleButton
UIA patterns available: LegacyIAccessiblePattern, InvokePattern, ScrollItemPattern

Any idea is welcome. Thanks in advance.
Kind regards,

Cyrille



--
Derek Riemer
Improving the world one byte at a time!        ⠠⠊⠍⠏⠗⠕⠧⠬ ⠮ ⠸⠺ ⠐⠕ ⠃⠽⠞⠑ ⠁⠞ ⠁ ⠐⠞⠖
•    Accessibility enthusiast.
•    Proud user of the NVDA screen reader.
•    Open source enthusiast.
•    Skier.

•    Personal website: https://derekriemer.com




Cyrille
 

Hi Derek

 

Thanks you for your interest to my issue and for your reply.

 

  1. Regarding eventHandler.registerEvent, I did not find such a function/method neither in eventHandler.py, neither elsewhere in NVDA’s code (py2 or py3). Am I mistaken or should I search for another function name?

 

  1. You asked: is NVDA ever showing the alert?

My reply:: How can I know this?

 

  1. I can obj-navigate to this object and get NVDA dev info, as you can see in my previous e-mail. However, I do not know how to use this information with regard to events

 

Thanks

Cheers

 

Cyrille

 

 

De : nvda-devel@groups.io <nvda-devel@groups.io> De la part de derek riemer
Envoyé : samedi 23 novembre 2019 14:06
À : nvda-devel@groups.io
Objet : Re: [nvda-devel] How to detect the creation of a UI object?

 

you may need to check out eventHandler.registerEvents. There are some events we hide creation of, because otherwise, you'll get spammed with events and that can be expensive to handle. Also, uia does interesting things, and this is always difficult. is NVDA ever showing the alert? If you can object nav to it and look, you might be able to know more.

 

On Fri, Nov 22, 2019 at 2:04 AM Cyrille via Groups.Io <cyrille.bougot2=laposte.net@groups.io> wrote:

Hello

I would like to be able to detect the creation of a button. Is there an associated event? How to know it? And how to let NVDA listen to this event?

Detailed context:
In Outlook 2016, when you type an e-mail address in the "To" field, an alert message is displayed if an auto-reply has been configured for this e-mail address on the Exchange server.
I would like to alert the NVDA user when this alert pops up. This alert contains a button that allows to remove the corresponding e-mail address from the "To" field.

What I have tried:
I have tried to subclass this button and to define event_NVDAObject_init. However, it seems that NVDAObjects are created only when NVDA needs it (object getting focus, navigator object, etc.). The NVDAObject is not created as soon as the object occurs.

Questions:
how to be informed that this button has been created in the UI? Does NVDA need to subscribe to an event in an accessibility API? If yes, how to do this?

Below is the dev info when I press NVDA+F1 on this button
Developer info for navigator object:
name: u'DUPONT Jean 12345'
role: ROLE_BUTTON
states: STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <appModules.outlook.UIARecipientButton object at 0x0DCE17B0>
Python class mro: (<class 'appModules.outlook.UIARecipientButton'>, <class 'NVDAObjects.UIA.UIA'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: u"\ufeff \r\n\r\nThis is an out-of-office message. Supprimer le destinataire\xa0: Jean DUPONT 12345"
location: RectLTWH(left=67, top=221, width=143, height=20)
value: None
appModule: <'outlook' (appName u'outlook', process ID 2812) at address aa58870>
appModule.productName: u'Microsoft Outlook'
appModule.productVersion: u'16.0.4900.1000'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 3278568
windowClassName: u'NetUIHWND'
windowControlID: 0
windowStyle: 1442840576
extendedWindowStyle: 0
windowThreadID: 1892
windowText: u''
displayText: u''
UIAElement: <POINTER(IUIAutomationElement) ptr=0xa42ac00 at dae7da0>
UIA automationID: RecipientButton
UIA frameworkID:
UIA runtimeID: (42, 3278568, 3, -1265467264, 0)
UIA providerDescription: [pid:2812,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:mso40uiwin32client.dll)]
UIA className: NetUISimpleButton
UIA patterns available: LegacyIAccessiblePattern, InvokePattern, ScrollItemPattern

Any idea is welcome. Thanks in advance.
Kind regards,

Cyrille



--

Derek Riemer
Improving the world one byte at a time!        ⠠⠊⠍⠏⠗⠕⠧⠬ ⠸⠺ ⠐⠕ ⠃⠽⠞⠑ ⠁⠞ ⠐⠞⠖
•    Accessibility enthusiast.
•    Proud user of the NVDA screen reader.
•    Open source enthusiast.
•    Skier.

•    Personal website: https://derekriemer.com