AccNotifyTouchInteraction 関数 (oleacc.h)

ユーザーからのタッチ ジェスチャの結果として、支援技術 (AT) アプリケーションが Windows オートメーション API (Microsoft UI オートメーション など) を介して UI と対話していることをシステムに通知できるようにします。 これにより、支援技術は、ユーザーがタッチと対話していることをターゲット アプリケーションとシステムに通知できます。

構文

HRESULT AccNotifyTouchInteraction(
  [in] HWND  hwndApp,
  [in] HWND  hwndTarget,
  [in] POINT ptTarget
);

パラメーター

[in] hwndApp

AccNotifyTouchInteraction を呼び出している AT プロセスに属するウィンドウ。

[in] hwndTarget

AT がターゲットとするオートメーション要素の最も近いウィンドウ。

[in] ptTarget

オートメーション要素の中心点 (または要素の外接する四角形内の点)。

戻り値

成功した場合は、S_OK を返します。

成功しなかった場合は、標準の COM エラー コードを返します。

注釈

この関数では、呼び出し元プロセスに UIAccess 以上の特権が必要です。 呼び出し元に必要な特権がない場合、 AccNotifyTouchInteraction の呼び出しは失敗し、 E_ACCESSDENIEDを返します。 詳細については、「 支援テクノロジのセキュリティに関する考慮事項 」および 「/MANIFESTUAC (マニフェストに UAC 情報を埋め込む)」を参照してください。

AT がタッチ データを使用している場合 ( RegisterPointerInputTarget 関数を使用する場合など)、AT が Windows Automation API を介して対話するシェルとアプリケーションは、ユーザーがタッチを介してやり取りしていることを認識しません。 システムがタッチ関連の機能をユーザーに公開するには、AT は AccNotifyTouchInteraction を使用して、ユーザーのタッチ入力に応答して対話を実行していることをシステムに通知する必要があります。

このコード例では、 AccNotifyTouchInteraction 関数を呼び出す方法を示します。

// pTargetElement is the element being interacted with by the user, hwndApp 
// represents an HWND owned by the AT.
HRESULT PerformTouchBasedInteraction(IUIAutomationElement *pTargetElement, 
        HWND hwndApp)
{
    HRESULT hr = S_OK;

    // Set the focus to the element and then notify the system that the 
    // interaction is occurring due to a touch gesture. This would also apply 
    // to pattern-based interactions (such as calls to 
    // IUIAutomationInvokePattern::Invoke)
    hr = pTargetElement->SetFocus();
    if (SUCCEEDED(hr))
    {
        HWND hwndTarget;
        POINT ptTarget;
        BOOL fGotClickablePoint;

        // If the current element does not have a native window handle, an 
        // alternate method (such as walking up the parent chain) is required 
        // to get the nearest valid HWND.
        hr = pTargetElement->get_CurrentNativeWindowHandle((UIA_HWND *)(&hwndTarget));
        if (SUCCEEDED(hr))
        {
            // If the provider doesn't return a clickable point, an alternate 
            // method (such as using the bounding rectangle) will be required 
            // to get the center point of the current element.
            hr = pTargetElement->GetClickablePoint(&ptTarget, &fGotClickablePoint);
        }

        if (SUCCEEDED(hr) && fGotClickablePoint)
        {
            hr = AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget);
        }
    }

    return hr;
}

要件

要件
サポートされている最小のクライアント Windows 8 [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows Server 2012 [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー oleacc.h
Library Oleacc.lib
[DLL] Oleacc.dll

こちらもご覧ください

AccSetRunningUtilityState

RegisterPointerInputTarget

UnregisterPointerInputTarget