AXObserverAddNotification(_:_:_:_:)
Registers the specified observer to receive notifications from the specified accessibility object.
Declaration
func AXObserverAddNotification(_ observer: AXObserver, _ element: AXUIElement, _ notification: CFString, _ refcon: UnsafeMutableRawPointer?) -> AXErrorParameters
- observer:
The observer object created from a call to 1460133 Axobservercreate.
- element:
The accessibility object for which to observe notifications.
- notification:
The name of the notification to observe.
- refcon:
Application-defined data passed to the callback when it is called.
Return Value
If unsuccessful, AXObserverAddNotification may return one of the following error codes, among others:
kAXErrorInvalidUIElementObserverThe observer is not a valid AXObserverRef type.
kAXErrorIllegalArgumentOne or more of the arguments is an illegal value or the length of the notification name is greater than 1024.
kAXErrorNotificationUnsupportedThe accessibility object does not support notifications (note that the system-wide accessibility object does not support notifications).
kAXErrorNotificationAlreadyRegisteredThe notification has already been registered.
kAXErrorCannotCompleteThe function cannot complete because messaging has failed in some way.
kAXErrorFailureThere is some sort of system memory failure.