Important: The information in this document is obsolete and should not be used for new development.
AEGetEventHandler
You can use theAEGetEventHandlerfunction to get an entry from an Apple event dispatch table.
FUNCTION AEGetEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: EventHandlerProcPtr; VAR handlerRefcon: LongInt; isSysHandler: Boolean): OSErr;
theAEEventClass- The value of the event class field of the dispatch table entry for the desired handler.
theAEEventID- The value of the event ID field of the dispatch table entry for the desired handler.
handler- The
AEGetEventHandlerfunction returns, in this parameter, a pointer to the specified handler.handlerRefcon- The
AEGetEventHandlerfunction returns, in this parameter, the reference constant from the dispatch table entry for the specified handler.isSysHandler
Specifies the Apple event dispatch table from which to get the handler. If the value ofisSysHandlerisTRUE, theAEGetEventHandlerfunction returns the handler from the system dispatch table. If the value isFALSE,AEGetEventHandlerreturns the handler from your application's dispatch table.DESCRIPTION
TheAEGetEventHandlerfunction returns, in thehandlerparameter, a pointer to the handler for the Apple event dispatch table entry you specify in the parameterstheAEEventClassandtheAEEventID. You can use thetypeWildCardconstant for either or both of these parameters; however,AEGetEventHandlerreturns an error unless an entry exists that specifiestypeWildCardin exactly the same way. For example, if you specifytypeWildCardin both thetheAEEventClassparameter and thetheAEEventIDparameter, the Apple Event Manager will not return the first handler for any event class and event ID in the dispatch table; instead, the dispatch table must contain an entry that specifies typetypeWildCardfor both the event class and the event ID.RESULT CODES
noErr 0 No error errAEHandlerNotFound -1717 No handler found for an Apple event SEE ALSO
For an explanation of wildcard values, see the description of theAEInstallEventHandlerfunction on page 4-62.