IUIAutomationSynchronizedInputPattern::StartListening method (uiautomationclient.h)

Causes the Microsoft UI Automation provider to start listening for mouse or keyboard input.

Syntax

HRESULT StartListening(
  [in] SynchronizedInputType inputType
);

Parameters

[in] inputType

Type: SynchronizedInputType

A combination of values specifying the type of input to listen for.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

When matching input is found, the provider checks whether the target element matches the current element. If they match, the provider raises the UIA_InputReachedTargetEventId event; otherwise it raises the UIA_InputReachedOtherElementEventId or UIA_InputDiscardedEventId event.

After receiving input of the specified type, the provider stops checking for input and continues as normal.

If the provider is already listening for input, this method returns E_INVALIDOPERATION.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008, Windows Server 2003 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See also

IUIAutomationSynchronizedInputPattern