Selection Property

[This is preliminary documentation and subject to change.]

An object's Selection property, retrieved by calling the IAccessible::get_accSelection method, allows clients to discover which children within an accessible object are selected.

Like many elements in Windows applications, accessible objects can be selected and receive keyboard focus. These attributes enable users to interact with application elements, changing values or otherwise manipulating them.

Note Object selection and object focus are two entirely different ideas. The "focused" object is the one object in the entire system that receives keyboard input, while the "selected" object is marked to participate in some type of group operation. Additionally, focused items can be in or out of a selection of items. For example, you can select several items in a list view control in preparation for moving or deleting them all. However, the focus is given only to one object in the system at a time.

Menus do not incorporate item selection. When a user highlights menu items, the server must not generate EVENT_OBJECT_SELECTION events or any other selection related event. Instead, the server should generate an EVENT_OBJECT_FOCUS event specific to the object that is currently highlighted. This only applies to server creating custom menu code or a user interface that appears to the user as a menu. Active Accessibility provides support for the Win32 menus APIs. Menus created via Win32 APIs and Resource Files will send the correct events and expose MSAA objects.

Implementers: If the object has no children, but is itself selected, set the vt member to VT_I4 and lVal to CHILDID_SELF. If no child is selected, set vt to VT_EMPTY. If multiple children are selected, set vt to VT_UNKNOWN and punkVal to the IUnknown interface pointer of an object that can be used to enumerate the child objects. This object must support the IEnumVARIANT interface.