Getting an Accessible Object Interface Pointer
Microsoft Active Accessibility client applications retrieve interface pointers to accessible objects by using one of the following functions.
Many clients look up information about specific accessible objects that generate events. Because the IAccessible interface is the "gateway" to accessible objects, clients must have an easy way to associate WinEvents with the IAccessible interface of the object generating the events. Microsoft Active Accessibility provides the AccessibleObjectFromEvent function specifically for this purpose.
The AccessibleObjectFromEvent function accepts much of the same information that a client's hook function receives. When a client hook function receives an event notification, it passes the appropriate parameters from events to AccessibleObjectFromEvent.
The function retrieves either the IAccessible interface of the user interface element that generated the event or the interface of the element's parent object. If the parent object's interface pointer is returned, the client calls the parent's properties and methods to obtain information about the child element that generated the event.
It is possible that servers return distinct interface pointers for the same user interface element each time the AccessibleObjectFromEvent, AccessibleObjectFromPoint, or AccessibleObjectFromWindow function is called. To determine if two pointers refer to the same user interface element, client developers must compare IAccessible properties of the object, not pointers.