AERemoveEventHandler(_:_:_:_:)
Removes an event handler entry from an Apple event dispatch table.
Declaration
func AERemoveEventHandler(_ theAEEventClass: AEEventClass, _ theAEEventID: AEEventID, _ handler: AEEventHandlerUPP!, _ isSysHandler: Bool) -> OSErrParameters
- theAEEventClass:
The event class for the handler to remove. See Aeeventclass.
- theAEEventID:
The event ID for the handler to remove. See Aeeventid.
- handler:
A universal procedure pointer to the handler to remove. Although the parameters
theAEEventClassandtheAEEventIDare sufficient to identify the handler, you can identify the handler explicitly as a safeguard. If you passNULLfor this parameter, the Apple Event Manager relies solely on the event class and event ID to identify the handler.If you use the
typeWildCardconstant for either or both of the event class and event ID parameters,AERemoveEventHandlerwill return an error unless an entry exists that specifiestypeWildCardin exactly the same way. For example, if you specifytypeWildCardin both thetheAEEventClassparameter and thetheAEEventIDparameter,AERemoveEventHandlerwill not remove the first handler for any event class and event ID in the dispatch table; instead, it will only remove a handler if an entry exists that specifies typetypeWildCardfor both the event class and the event ID.For an explanation of wildcard values, see the Discussion section for 1448596 Aeinstalleventhandler.
See Aeeventhandlerupp.
- isSysHandler:
Specifies the Apple event dispatch table to remove the handler from. Pass
TRUEto remove the handler from the system dispatch table orFALSEto remove the handler from your application’s dispatch table. See Version Notes for related information.
Return Value
A result code. See Result Codes.
Discussion
Thread safe starting in OS X v10.2.
Your application should not install a handler in a system dispatch table with the goal that the handler will get called when other applications receive events—this won’t work in macOS. For more information, see The System Dispatch Table in Apple Event Dispatching in Apple Events Programming Guide.