Share via


IRawElementProviderAdviseEvents::AdviseEventRemoved Method

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

Syntax

HRESULT AdviseEventRemoved(      
    EVENTID eventId,
    SAFEARRAY *propertyIDs
);

Parameters

  • eventId
    [in] The identifier of the event being removed. For a list of event IDs, see Event Identifiers.
  • propertyIDs
    [in] The address of a SAFEARRAY that contains the identifiers of the properties being removed, or NULL if the event listener being removed is not listening for property events.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

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

It is important for Microsoft UI Automation providers to treat the IRawElementProviderAdviseEvents::AdviseEventRemoved like the Release 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.

See Also

IRawElementProviderAdviseEvents, Working with Safe Arrays