Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 4 - Responding to Apple Events / Reference to Responding to Apple Events
Routines for Responding to Apple Events / Suspending and Resuming Apple Event Handling


AEGetTheCurrentEvent

You can use the AEGetTheCurrentEvent function 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, AEGetTheCurrentEvent returns 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. The AEGetTheCurrentEvent function makes it unnecessary for these calls to include the current Apple event as a parameter; the routines can simply call AEGetTheCurrentEvent to get the current Apple event when it is needed.

You can also use the AEGetTheCurrentEvent function 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 call AEGetTheCurrentEvent and delete the file only if AEGetTheCurrentEvent returns a null descriptor record (that is, only if no Apple event is currently being handled).

RESULT CODE
noErr0No error

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996