addPropertyChangedEventHandler method

void addPropertyChangedEventHandler(
  1. IUIAutomationElement? element,
  2. TreeScope scope,
  3. IUIAutomationCacheRequest? cacheRequest,
  4. IUIAutomationPropertyChangedEventHandler? handler,
  5. Pointer<SAFEARRAY> propertyArray,
)

Registers a method that handles and array of property-changed events.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-addpropertychangedeventhandler.

Implementation

@pragma('vm:prefer-inline')
void addPropertyChangedEventHandler(
  IUIAutomationElement? element,
  TreeScope scope,
  IUIAutomationCacheRequest? cacheRequest,
  IUIAutomationPropertyChangedEventHandler? handler,
  Pointer<SAFEARRAY> propertyArray,
) {
  final hr$ = HRESULT(
    _AddPropertyChangedEventHandlerFn(
      ptr,
      element?.ptr ?? nullptr,
      scope,
      cacheRequest?.ptr ?? nullptr,
      handler?.ptr ?? nullptr,
      propertyArray,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}