Skip to content

Latest commit

 

History

History
137 lines (104 loc) · 6.09 KB

nf-uiautomationcore-irawelementproviderwindowlesssite-getadjacentfragment.md

File metadata and controls

137 lines (104 loc) · 6.09 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:uiautomationcore.IRawElementProviderWindowlessSite.GetAdjacentFragment
IRawElementProviderWindowlessSite::GetAdjacentFragment (uiautomationcore.h)
Retrieves a fragment pointer for a fragment that is adjacent to the windowless Microsoft ActiveX control owned by this control site.
GetAdjacentFragment
GetAdjacentFragment method [Windows Accessibility]
GetAdjacentFragment method [Windows Accessibility]
IRawElementProviderWindowlessSite interface
IRawElementProviderWindowlessSite interface [Windows Accessibility]
GetAdjacentFragment method
IRawElementProviderWindowlessSite.GetAdjacentFragment
IRawElementProviderWindowlessSite::GetAdjacentFragment
uiautomationcore/IRawElementProviderWindowlessSite::GetAdjacentFragment
winauto.uiauto_IRawElementProviderWindowlessSite_GetAdjacentFragment
winauto\uiauto_IRawElementProviderWindowlessSite_GetAdjacentFragment.htm
WinAuto
2C43EA00-5C8E-4301-9BFF-9A5D1C585824
12/05/2018
GetAdjacentFragment, GetAdjacentFragment method [Windows Accessibility], GetAdjacentFragment method [Windows Accessibility],IRawElementProviderWindowlessSite interface, IRawElementProviderWindowlessSite interface [Windows Accessibility],GetAdjacentFragment method, IRawElementProviderWindowlessSite.GetAdjacentFragment, IRawElementProviderWindowlessSite::GetAdjacentFragment, uiautomationcore/IRawElementProviderWindowlessSite::GetAdjacentFragment, winauto.uiauto_IRawElementProviderWindowlessSite_GetAdjacentFragment
uiautomationcore.h
UIAutomation.h
Windows
Windows 8 [desktop apps \| UWP apps]
Windows Server 2012 [desktop apps \| UWP apps]
UIAutomationCore.idl
Windows
19H1
IRawElementProviderWindowlessSite::GetAdjacentFragment
uiautomationcore/IRawElementProviderWindowlessSite::GetAdjacentFragment
c++
APIRef
kbSyntax
COM
UIAutomationCore.h
IRawElementProviderWindowlessSite.GetAdjacentFragment

IRawElementProviderWindowlessSite::GetAdjacentFragment

-description

Retrieves a fragment pointer for a fragment that is adjacent to the windowless Microsoft ActiveX control owned by this control site.

-parameters

-param unnamedParam1 [in]

Type: NavigateDirection

A value that indicates the adjacent fragment to retrieve (parent, next sibling, previous sibling, and so on).

-param ppParent [out, retval]

Type: IRawElementProviderFragment**

Receives the adjacent fragment.

-returns

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. The return value is E_INVALIDARG if the direction is NavigateDirection_FirstChild or NavigateDirection_LastChild, which are not valid for this method. If there is no adjacent fragment in the requested direction, the method returns S_OK and sets ppRetVal to NULL.

-remarks

To return the parent of the fragment, an object that implements the IRawElementProviderFragment interface must be able to implement the Navigate method. Implementing Navigate is difficult for a windowless ActiveX control because the control might be unable to determine its location in the accessible tree of the parent object. The GetAdjacentFragment method enables the windowless ActiveX control to query its site for the adjacent fragment, and then return that fragment to the client that called Navigate.

A provider typically calls this method as part of handling the IRawElementProviderFragment::Navigate method.

Examples

The following C++ code example shows how to implement the GetAdjacentFragment method.

IFACEMETHODIMP CProviderWindowlessSite::GetAdjacentFragment(
        enum NavigateDirection direction, IRawElementProviderFragment **ppFragment)   
{
    if (ppFragment == NULL)
    {
        return E_INVALIDARG;
    }
    
    *ppFragment = NULL;
    HRESULT hr = S_OK;

    switch (direction)
    {
        case NavigateDirection_Parent:
            {  
                IRawElementProviderSimple *pSimple = NULL;

                // Call an application-defined function to retrieve the
                // parent provider interface.
                hr = GetParentProvider(&pSimple);  
                if (SUCCEEDED(hr))  
                {  
                    // Get the parent's IRawElementProviderFragment interface.
                    hr = pSimple->QueryInterface(IID_PPV_ARGS(ppFragment));  
                    pSimple->Release();  
                } 
            }  
            break;  
  
        case NavigateDirection_FirstChild:
        case NavigateDirection_LastChild:
            hr = E_INVALIDARG;
            break;

        // Ignore NavigateDirection_NextSibling and NavigateDirection_PreviousSibling
        // because there are no adjacent fragments.
        default:  
            break;  
    }  
  
    return hr;  
}   

-see-also

IRawElementProviderWindowlessSite