IUIAutomationProxyFactoryEntry::SetWinEventsForAutomationEvent method (uiautomationclient.h)

Maps Microsoft UI Automation events to WinEvents.

Syntax

HRESULT SetWinEventsForAutomationEvent(
  [in] EVENTID    eventId,
  [in] PROPERTYID propertyId,
  [in] SAFEARRAY  *winEvents
);

Parameters

[in] eventId

Type: EVENTID

The event identifier. For a list of event identifiers, see Event Identifiers.

[in] propertyId

Type: PROPERTYID

The property identifier. For a list of property IDs, see Property Identifiers.

[in] winEvents

Type: SAFEARRAY*

The list of WinEvents that map to this event.

Return value

Type: HRESULT

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

Remarks

When a client application subscribes to a UI Automation event, the UI Automation core also listens for WinEvents that map to this event. For example, suppose that UIA_Invoke_InvokedEventId is mapped to EVENT_OBJECT_INVOKED. When EVENT_OBJECT_INVOKED is raised, the client instantiates the proxy and calls RespondToWinEvent on that proxy. In the implementation of RespondToWinEvent, the proxy calls AddAutomationEvent. The core then raises the corresponding UI Automation event.

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

Best Practices for Using Safe Arrays

Conceptual

GetWinEventsForAutomationEvent

IUIAutomationProxyFactoryEntry

Reference