AERemoveEventHandler
AERemoveEventHandler Remove entry from Apple Event dispatch table
#include <AppleEvents.h> Apple Event Manager
OSErr AERemoveEventHandler ( theAEEventClass, theAEEventID,
handler, isSysHandler );
AEEventClass theAEEventClass ; event class
AEEventID theAEEventID ; event ID
EventHandlerProcPtr handler ; pointer to event handler
Boolean isSysHandler ; see below
returns Error Code; 0 = no error
The parameter theAEEventClass is the event class for the handler to be
removed. The parameter theAEEventID is the event ID for the handler to be
removed. You can use the typeWildCard constant for either or both of these
parameters. (For an explanation of wildcard values, see the description of the
The handler parameter is a pointer to the Apple event handler to be removed.
Although the parameters theAEEventClass and theAEEventID would be sufficient
to identify the handler to be removed, providing the handler parameter is a
safeguard that ensures that you're removing the correct handler.
The isSysHandler parameter specifies the Apple event dispatch table from
which to remove the handler. If isSysHandler is TRUE,
AERemoveEventHandler removes the handler from the system dispatch
table. If isSysHandler is FALSE, AERemoveEventHandler removes the
handler from your application's dispatch table.
AERemoveEventHandler removes the Apple event dispatch table entry you
specify in the parameters theAEEventClass , the AEEventID, and handler. You
can use the typeWildCard constant for theAEEventClass or the theAEEventID
parameter, or for both parameters; however, AERemoveEventHandler will
return an error unless an entry exists that specifies typeWildCard in exactly
the same way. For example, if you specify typeWildCard in both the
theAEEventClass and theAEEventID parameters, the Apple Event Manager
will not remove the first handler for any event class and event ID in the
dispatch table; instead, the dispatch table must contain an entry that specifies
type typeWildCard for both the event class and the event ID, or else
AERemoveEventHandler will return an error.
Result codes
noErr (0) No error
errAEHandlerNotFound (-1717) No handler found for an Apple event