ISynchronizedInputProvider::StartListening method

Starts listening for input of the specified type.


HRESULT StartListening(



This method has no parameters.

Return Value


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


When it finds matching input, the provider checks if the target UI Automation 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. The UI Automation provider must discard the input if it is for an element other than this one.

This is a one-shot method; after receiving input, the provider stops listening and continues normally.

This method returns E_INVALIDOPERATION if the provider is already listening for input.


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 | UWP apps]
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 | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See Also