Implementing the IAccessibleApplication Interface
The IAccessibleApplication interface can be used to customize how screen readers such as JAWS identify an application. Specifically, the IAccessibleApplication::get_appName function can be used to specify that JAWS should use a specific name for the application instead of deriving the name for the application from the name of the application’s executable file.
C++/ATL and MFC
In order to support the IAccessibleApplication interface in an ATL/MFC application you need to use a custom IAccessible Proxy. To create a custom IAccessible Proxy do the following.
- Create a customized version of the IAccessibleProxyImpl class and CAccessibleProxy class using source code obtained from atlacc.h.
- Add a COM_INTERFACE_ENTRY for IAccessibleApplication in the COM_MAP (BEGIN_COM_MAP/END_COM_MAP) for the custom IAccessibleProxyImpl class.
- Use the BEGIN_SERVICE_MAP, END_SERVICE_MAP, and SERVICE_ENTRY macros to provide an implementation of the IServiceProvider interface.
- Provide an override for the CWnd::CreateAccessibleProxy function to cause your windows to use the custom accessible proxy and thus your implementation of the IAccessibleApplication interface.
You should do this for every window that can gain focus in your application.
You can refer to the open source TTSApp application for additional details on how to do this. Pay special attention to the following files.
The implementation of the custom IAccessible Proxy.
Source for the IAccessibleApplication interface implementation.
Header file for the IAccessibleApplication interface implementation.
Source for the class that is used for all windows that can gain focus in the TTSApp application.
Header file for the class that is used for all windows that can gain focus in the TTSApp application.
The following web pages supply additional information.
- IAccessible2 Implementation Guide
- How to Handle WM_GETOBJECT
- Implementing a Microsoft Active Accessibility (MSAA) Server: Practical Tips for Developers and How Mozilla Does It