IRawElementProviderAdviseEvents::AdviseEventAdded method

Notifies the Microsoft UI Automation provider when a UI Automation client begins listening for a specific event, including a property-changed event.

Syntax


HRESULT AdviseEventAdded(
  [in]  EVENTID eventId,
  [in]  SAFEARRAY *propertyIDs
);

Parameters

eventId [in]

Type: EVENTID

The identifier of the event being added. For a list of event IDs, see Event Identifiers.

propertyIDs [in]

Type: SAFEARRAY*

A pointer to the identifiers of properties being added, or NULL if the event listener being added is not listening for property events.

Return value

Type: HRESULT

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

Remarks

This method enables the provider to reduce overhead by raising only events that are being listened for.

It is important for UI Automation providers to treat the IRawElementProviderAdviseEvents::AdviseEventAdded like the AddRef method of the IUnknown interface. As long as AdviseEventAdded has been called more times than AdviseEventRemoved for a specific event or property, the provider should continue to raise corresponding events, because some clients are still listening. Alternatively, UI Automation providers can use the UiaClientsAreListening function to determine if at least one client is listening and, if so, raise all appropriate events.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

UIAutomationCore.h (include UIAutomation.h)

IDL

UIAutomationCore.idl

See also

Reference
IRawElementProviderAdviseEvents
Conceptual
Best Practices for Using Safe Arrays

 

 

Community Additions

ADD
Show:
© 2014 Microsoft