Re: how to make a control more accessible

Travis Siegel

It's actually calling routines in the ATL.DLL windows library file.  Two routines from that dll initialize and process the html view.

The atl.dll file on my windows 8.1 system has a file stamp of 2014, so it's a relatively old dll to be sure.  But, that means this code will work on just about any version of windows, which was my primary intent when I started the project.  Admittedly, I didn't have a clue how to do what I wanted (I.E. embed an html control into my program) when I started, but via some heavy use of google, and a bit of searching on my favorite programming sites, I found this little gem that was only a couple functions, a couple api calls, and poof, exactly what I wanted.

Interestingly enough, under jaws, if I tell jaws that the control is an html area, it behaves properly, (which it most certainly did not do before doing so).  In fact, before I told jaws it was an html control, jaws couldn't even find the text on the screen.  To fix that problem, I had to add the html area to the tab order, then tell jaws it was anhtml control, after that, jaws works like a dream, pressing the button (or hot key) to go to the next chapter starts jaws reading the text automatically just as soon as it comes up on the screen.

I was hoping I could do something similar for NVDA.

Especially, since NVDA doesn't suffer from the issue of not knowing the html control is on the screen, it finds it just fine, and I can even read it, but again, I have to use the numpad keys to work my way through the text.  Interestingly enough, NVDA doesn't seem to know about the various headers, links, and other html elements in the text, but jaws not only sees them, but alows me to click on them as if it were an actual browser.  I'm not real happy with that result, since it means NVDA is being shown up at something it initially has a much better handle on, so if I could tell NVDA this is an html area, and allow it to behave accordingly, I'm fairly certain all would work like a treat.

I just don't know how to do that.

On 8/13/2019 5:50 PM, James Scholes wrote:

It may be helpful in this instance to have a runnable sample. However, straight off the bat, I'd recommend using a more up-to-date rendering engine for your web view (Chromium would be ideal for instance via CEF).

What environment is creating the web view?  Is it a standard Win32 app? WPF?  WinForms?  UWP?  Something else?


James Scholes

On 13/08/2019 at 9:21 pm, Travis Siegel wrote:
I have a program I'm working on that has an html view as part of it's main screen.  NVDA reads the text well enough, but it doesn't read it well, in that it breaks lines at unexpected places, and it doesn't show embedded links. The links isn't really a problem, since I'm not really concerned with links pointing elsewhere anyhow, so that's only a minor issue, but I would like to know how to get NVDA to treat this text area as html text, so it will pay attention to things like headers, and handle the reading a bit better, since now it's reading the text in the window in fragments, and most of the time, those fragments aren't making sense.

Admittedly, I'm not sure how much control I have over the presentation of the text, since it's an imported one, (it calls a windows dll/api to render the text), but when I look at the text line by line, it seems odd to me where NVDA is choosing to put breaks, as well as the fact that the read to end function in NVDA doesn't work.  This at least is one thing I'd really like to fix, since reading is the primary purpose of the app.  I'll include the nvda-F1 text below for the control, perhaps someone here can help me figure out what I need to do to make it work better, whether it be via NVDA plugins, or just adding attributes to the window. There's only so much I can do programatically, since it's an api/dll call, but I'm certainly open to suggestions.  It works as is, but reading the text requires the nvda cursor, not the system one, and I know some folks aren't going to like that, so again, any suggestions would be appreciated.

** cut here **

Developer info for navigator object:
name: u'Copyright'
isFocusable: True
hasFocus: False
Python object: <NVDAObjects.Dynamic_EditableTextWithoutAutoSelectDetectionBodyMSHTMLIAccessible object at 0x05256770>
Python class mro: (<class 'NVDAObjects.Dynamic_EditableTextWithoutAutoSelectDetectionBodyMSHTMLIAccessible'>, <class 'NVDAObjects.behaviors.EditableTextWithoutAutoSelectDetection'>, <class 'editableText.EditableTextWithoutAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.IAccessible.MSHTML.Body'>, <class 'NVDAObjects.IAccessible.MSHTML.MSHTML'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: None
location: RectLTWH(left=412, top=186, width=759, height=628)
value: ''
appModule: <'appModuleHandler' (appName u'reader', process ID 1084) at address 52567b0>
appModule.productName: exception: No version information
appModule.productVersion: exception: No version information
TextInfo: <class 'NVDAObjects.IAccessible.MSHTML.MSHTMLTextInfo'>
windowHandle: 2556670
windowClassName: u'Internet Explorer_Server'
windowControlID: 0
windowStyle: 1442840576
windowThreadID: 6488
windowText: u''
displayText: u''
IAccessibleObject: <POINTER(IAccessible) ptr=0x9039038 at 5085170>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=2556670, objectID=None, childID=0
IAccessible accName: u'Copyright'
IAccessible accRole: ROLE_SYSTEM_PANE
IAccessible accDescription: exception: (-2147467263, 'Not implemented', (None, None, None, 0, None))
IAccessible accValue: u'file://C:\\books\\storybundle\\Adventure\\Singularity - Bill DeSmedt\\OEBPS\\copyright.xhtml'
MSHTML node has ancestor IAccessible: False
MSHTML nodeName: u'body'
** cut here**

I'm actually not sure why it's claiming it's an editable object, because it's most certainly not editable <frown>

The rest seems to be correct though.

Join to automatically receive all group messages.