Visual Basic

Why Should I Use Active Accessibility?

Before starting in on a discussion of how to use Active Accessibility, I need to offer a little more of an explanation as to the purpose of Active Accessibility and how it works.

Active Accessibility uses Component Object Model (COM) technology to expose interfaces that provide a common means of communication among applications. What does that mean? Let's look at an example. Accessible computing often involves more than the guidelines and considerations discussed so far in this chapter. For computers to be accessible to everyone, special devices, known as accessibility aids, sometimes are required. Examples of such aids are screen readers and special input devices. The developers of accessibility aids must create software that communicates with the existing operating system and application software running on the computer. Without Active Accessibility, establishing these communications can be difficult. In order for the accessibility aid software to communicate with the system software, it's required to know or discover a lot of details about the specific types of software. When software applications are created with Active Accessibility, the accessibility aids don't need to know any application-specific details. They can find out what is on the screen and how to use it from the common interfaces exposed by Active Accessibility.

From this you might have figured out that there are two sides to Active Accessibility: the client and the server. The client is the hardware and software for the accessibility aid that is trying to retrieve information. The server is the software application that is exposing accessible interfaces so that the client can easily retrieve the desired user interface information.

My intent when I started writing this was to demonstrate how to make your Visual Basic application available as a server. Unfortunately, after a lot of work and some discussion with Microsoft's Active Accessibility group, I've discovered that the technology isn't quite ready yet for a Visual Basic server. As I said before, Active Accessibility is still very new, and it wasn't designed for use with Visual Basic. So what I've done instead is demonstrate what can be done from the client side. This will at least give you a chance to see how Active Accessibility works and should help prepare you to use it in the future.

Setting Up Your Project

Before you start building your project you of course need to load the Microsoft Active Accessibility SDK (MSAASDK). After you've loaded the SDK, you must create a reference in your project to the Accessibility DLL, OLEACC.DLL. Select References from the Project menu, then click the Browse button to find the OLEACC.DLL file. By default this file is located in the \Windows\System folder. Once you've created the reference, you can view the Accessibility library through the Object Browser in Visual Basic. When you select Accessibility from the Project/Library drop-down list in the Object Browser, you won't see anything in the Classes or Member Of lists because the Accessibility settings are hidden. You need to right-click in the Members Of pane and select Show Hidden Members to view the Accessibility classes and members.

NOTE


If you're working without a mouse and you want to view the hidden files in the Object Browser, tab to the Members pane and press Shift+F10 to display the shortcut menu. Press H (for Show Hidden Members) on your keyboard and then press Enter.

Another means of accessing the shortcut menu is to enable the Windows MouseKeys option. Select Accessibility Options from the Control Panel and select the Mouse tab. Check the Use MouseKeys checkbox and click OK. You can now perform the right-click action in the Object Browser using your numeric keypad by pressing the minus key and then pressing the 5 key.