Selecting Child Objects

Clients call the IAccessible::accSelect method to modify selection or keyboard focus among the children in an object. The SELFLAG Constants specified with the call define the operation to perform.

If IAccessible::accSelect is called with the SELFLAG_TAKEFOCUS flag on a child object that has an HWND, the flag takes effect only if the object's parent has the focus.

Performing Complex Selection Operations

The following describes which SELFLAG values to specify when calling IAccessible::accSelect to perform complex selection operations.

To simulate a click

To select a target item by simulating CTRL + click

To cancel selection of a target item by simulating CTRL + click

To simulate SHIFT + click

To select a range of objects and put focus on the last object

  1. Specify SELFLAG_TAKEFOCUS on the starting object to set the selection anchor.
  2. Call IAccessible::accSelect again and specify SELFLAG_EXTENDSELECTION | SELFLAG_TAKEFOCUS on the last object.

To deselect all objects

  1. Specify SELFLAG_TAKESELECTION on any object. This flag deselects all selected objects except the one just selected.
  2. Call IAccessible::accSelect again and specify SELFLAG_REMOVESELECTION on the remaining object.