IAccessible::accDoDefaultAction

[This is preliminary documentation and subject to change.]

Performs the object's default action.

HRESULT accDoDefaultAction(
  VARIANT varChild
);
 

Parameters

varChild
[in] Value identifying the child whose default action will be invoked. This parameter can be the child ID value (provided by the object), CHILDID_SELF for the object itself, or a string identifying the child (such as "A1").

Return Values

Returns S_OK if successful or one of the following values or a standard COM error code otherwise.

DISP_E_MEMBERNOTFOUND
E_INVALIDARG

Remarks

You can retrieve the object's DefaultAction property by using the IAccessible::get_accDefaultAction method.

Only controls that perform actions support IAccessible::accDoDefaultAction. Some controls, like edit fields, can have a primary value but not a primary action.

In most cases, the client could also perform this action using standard OLE Automation, as well as carry out any nondefault actions supported by the object. However, this method provides an easy way to identify and perform an object's most commonly used function. Also, with the information provided by the IAccessible::get_accDefaultAction method, you can describe the action to the user even if the application does not ship an OLE Automation type library.