Skip to content

Latest commit

 

History

History
170 lines (129 loc) · 5.79 KB

nf-oleacc-iaccessible-get_accdefaultaction.md

File metadata and controls

170 lines (129 loc) · 5.79 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:oleacc.IAccessible.get_accDefaultAction
IAccessible::get_accDefaultAction (oleacc.h)
The IAccessible::get_accDefaultAction method retrieves a string that indicates the object's default action. Not all objects have a default action.
IAccessible interface [Windows Accessibility]
get_accDefaultAction method
IAccessible.get_accDefaultAction
IAccessible::get_accDefaultAction
_msaa_IAccessible_get_accDefaultAction
get_accDefaultAction
get_accDefaultAction method [Windows Accessibility]
get_accDefaultAction method [Windows Accessibility]
IAccessible interface
msaa.iaccessible_iaccessible__get_accdefaultaction
oleacc/IAccessible::get_accDefaultAction
winauto.iaccessible_iaccessible__get_accdefaultaction
winauto\iaccessible_iaccessible__get_accdefaultaction.htm
WinAuto
1261ff7c-7822-47c1-ac39-536b5ea09f31
12/05/2018
IAccessible interface [Windows Accessibility],get_accDefaultAction method, IAccessible.get_accDefaultAction, IAccessible::get_accDefaultAction, _msaa_IAccessible_get_accDefaultAction, get_accDefaultAction, get_accDefaultAction method [Windows Accessibility], get_accDefaultAction method [Windows Accessibility],IAccessible interface, msaa.iaccessible_iaccessible__get_accdefaultaction, oleacc/IAccessible::get_accDefaultAction, winauto.iaccessible_iaccessible__get_accdefaultaction
oleacc.h
Windows
Windows 2000 Professional [desktop apps only]
Windows Server 2003 [desktop apps only]
Oleacc.lib
Oleacc.dll
Windows
Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95
19H1
IAccessible::get_accDefaultAction
oleacc/IAccessible::get_accDefaultAction
c++
APIRef
kbSyntax
COM
Oleacc.dll
IAccessible.get_accDefaultAction

IAccessible::get_accDefaultAction

-description

The IAccessible::get_accDefaultAction method retrieves a string that indicates the object's default action. Not all objects have a default action.

-parameters

-param varChild [in]

Type: VARIANT

Specifies whether the retrieved default action is performed by the object or of one of the object's child elements. This parameter is either CHILDID_SELF (to obtain information about the object) or a child ID (to obtain information about the object's child element). For more information about initializing the VARIANT structure, see How Child IDs Are Used in Parameters.

-param pszDefaultAction [out, retval]

Type: BSTR*

Address of a BSTR that receives a localized string that describes the default action for the specified object; if this object has no default action, the value is NULL.

-returns

Type: HRESULT

If successful, returns S_OK.

If not successful, returns one of the values in the table that follows, or another standard COM error code. Servers return these values, but clients must always check output parameters to ensure that they contain valid values. For more information, see Checking IAccessible Return Values.

Error Description
S_FALSE
The specified object does not have a default action.
E_INVALIDARG
An argument is not valid.
DISP_E_MEMBERNOTFOUND
The specified object does not support this property.

-remarks

The retrieved string describes the action that is performed on an object, not what the object does as a result. For example, a toolbar button that prints a document has a default action of "Press" rather than "Prints the current document."

Do not confuse an object's default action with its value. For more information, see DefaultAction Property.

Only controls that perform actions support this method.

Note to server developers:  Localize the string returned from this property.

Server Example

The following example code shows a possible implementation of this method for a custom list box. For simplicity, the strings are not localized.
HRESULT STDMETHODCALLTYPE AccServer::get_accDefaultAction( 
    VARIANT varChild,
    BSTR *pszDefaultAction)
{
    if (varChild.vt != VT_I4)
    {
        *pszDefaultAction = NULL;
        return E_INVALIDARG;
    }
    if (varChild.lVal == CHILDID_SELF)
    {
        *pszDefaultAction = SysAllocString(L"None.");
    }
    else
    {
        *pszDefaultAction = SysAllocString(L"Double-click");
    }
    return S_OK;
};

-see-also

DefaultAction Property

IAccessible

IAccessible::accDoDefaultAction

VARIANT