Important: The information in this document is obsolete and should not be used for new development.
AEGetTheCurrentEvent
You can use theAEGetTheCurrentEventfunction to get the Apple event that is currently being handled.
FUNCTION AEGetTheCurrentEvent (VAR theAppleEvent: AppleEvent): OSErr;
theAppleEvent- The Apple event that is currently being handled; if no Apple event is currently being handled,
AEGetTheCurrentEventreturns a null descriptor record in this parameter.DESCRIPTION
In many applications, the handling of an Apple event involves one or more long chains of calls to internal routines. TheAEGetTheCurrentEventfunction makes it unnecessary for these calls to include the current Apple event as a parameter; the routines can simply callAEGetTheCurrentEventto get the current Apple event when it is needed.You can also use the
AEGetTheCurrentEventfunction to make sure that no Apple event is currently being handled. For example, suppose your application always uses an application-defined routine to delete a file. That routine can first callAEGetTheCurrentEventand delete the file only ifAEGetTheCurrentEventreturns a null descriptor record (that is, only if no Apple event is currently being handled).RESULT CODE
noErr 0 No error