Click to return to the Reusing Browser Technology home page    
MSHTML Accessibility Feat...     Reusing Browser Technolog...    
Web Workshop  |  Reusing Browser Technology

Adding Accessibility Aids to the Browser


This article provides an overview of Microsoft® Active Accessibility® for developers building applications with MSHTML.

Accessibility aids are applications that help people with disabilities use computers. Active Accessibility enables accessibility aids to communicate with the operating system and other applications through a common interface. The Active Accessibility API supports the integration of accessibility aids with accessibility-aware applications.

There are two basic types of accessibility aids. One type magnifies information on a screen, or provides audio interpretations of text and other visual elements on a screen. These accessibility aids benefit users with limited vision and the blind. The other type includes hardware and software tools that support users who have limited dexterity, enabling them to use different keyboard driver software and alternative input devices.

Active Accessibility supports HTML through the MSHTML dynamic-link library that is included with Microsoft® Internet Explorer 4.01 and later. MSHTML is the HTML parsing and rendering component in Internet Explorer.

The Platform SDK in the MSDN Online Library contains an overview of Active Accessibility, as well as the complete API reference. The IAccessible interface and the Active Accessibility events are documented in the Active Accessibility API reference, as is the rest of the Active Accessibility object model. Samples and tutorials are also included in the Platform SDK.

This article is divided into the following sections:

Prerequisites and Requirements

This documentation assumes that you are familiar with Microsoft® Win32® programming. You should also be familiar with COM programming.

To compile C/C++ programs that use the functionality provided by Active Accessibility, be sure that the Oleacc.h header file is in the include directory of your compiler. Because the interface to the accessible objects implements the IDispatch interface, Active Accessibility methods can be implemented by Microsoft® Visual Basic®-based applications also.

Accessibility Aid Background

Supporting Active Accessibility in your applications is the right thing to do. It allows everyone to use your software—including an estimated 50,000,000 users with disabilities.

Before the introduction of Active Accessibility, accessibility aid developers had to use cryptic hook mechanisms or creatively work around the operating system in an attempt to obtain the information they needed. Generally, the developers succeeded, but their applications were extremely reliant on implementation details that might change with the version of the operating system.

Using OLE technology, Active Accessibility provides a way to create high-performance, reliable tools that enable applications and accessibility aids to work together in helping users with special needs. Active Accessibility provides a comprehensive object model that includes the interfaces, libraries, and other elements that eliminate the need for unreliable workarounds.

Active Accessibility in Internet Explorer 4.01 and Later

The MSHTML component in Internet Explorer 4.01 supports the Microsoft Active Accessibility Proxy for HTML, or HTML Proxy. The HTML Proxy communicates with MSHTML through object model interfaces and events to provide an accessible representation of the content of a Web page.

The MSHTML component in Internet Explorer 5 and later exposes a native implementation of Active Accessibility, effectively replacing the HTML Proxy. Native implementation of Active Accessibility has resulted in significant performance gains, particularly with larger Web pages. This implementation is also more robust when compared with the HTML Proxy implementation. Internet Explorer 5 and later provides these performance and stability gains.

Accessible HTML Elements

Applications support Active Accessibility by exposing their user interface (UI) elements to client applications. These UI elements are presented to client applications in the form of accessible objects. Accessible objects maintain pieces of information, called properties, that describe the object's appearance, nature, and purpose. The IAccessible interface extends methods that enable an accessibility aid client to retrieve these properties. Using the information that these properties provide, accessibility aids can obtain information valuable to the user, and can convey it to the user as needed. MSHTML supports Active Accessibility by exposing HTML elements to client accessibility aids.

Some HTML elements—images, text, and links—are accessible, and some are not. Being accessible means that each instance of that element in an HTML document has an accessible representation of its own in the document's accessibility hierarchy.

For a list of the accessible and nonaccessible HTML elements in Internet Explorer 4.01, see DHTML Accessibility.

Making Nonaccessible Elements Accessible

Elements that are not accessible are ignored and are excluded from the document's accessibility hierarchy. These elements are treated as breaking points for the text stream that represents the data in the HTML document. They are treated as children of the element that contains them.

Accessible elements by themselves do not provide a complete solution to authoring accessible Web pages. With Internet Explorer 5, any element that has a tabIndex property with a value greater than zero can be considered accessible.

MSHTML allows the user to press the TAB key to move to elements on the page that can receive focus. MSHTML sends out the appropriate EVENT_OBJECT_FOCUS event. An Active Accessibility client can use AccessibleObjectFromEvent to get information about the child element that was focused.

Accessible HTML Events

MSHTML fires certain accessibility events, following some of the object model events. The following table shows these events and their corresponding Active Accessibility counterparts.

MSHTML eventActive Accessibility eventAvailability
IHTMLWindow2::get_onloadEVENT_OBJECT_CREATEInternet Explorer 5
IHTMLWindow2::get_onunloadEVENT_OBJECT_DESTROYInternet Explorer 4.01
IHTMLElement::get_onfocusEVENT_OBJECT_FOCUSInternet Explorer 4.01
IHTMLElement2::get_onblurEVENT_OBJECT_STATECHANGEInternet Explorer 4.01
IHTMLInputElement:get_onselectEVENT_OBJECT_STATECHANGEInternet Explorer 5
onpropertychangeEVENT_OBJECT_STATECHANGEInternet Explorer 5

If an accessibility client starts after MSHTML has started, these events enable the client to connect to the Active Accessibility implementation for MSHTML and start exposing content. Each event contains a window handle and a reference value with it, indicating the window and the element in the window for which the event is being fired. For the window itself, the unique identifier is zero. For all other elements, the reference contains the element's unique identifier, even though all events contained the same window handle when they fired.

The client application later calls back to the Active Accessibility system components with the window handle and the reference number. Active Accessibility then communicates the unique identifier of that element to the MSHTML implementation.

Related Topics

The following list contains links to topics related to Internet Explorer and Active Accessibility:



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.