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


AESuspendTheCurrentEvent

You can use the AESuspendTheCurrentEvent function to suspend the processing of the Apple event that is currently being handled.

FUNCTION AESuspendTheCurrentEvent 
                           (theAppleEvent: AppleEvent): OSErr;
theAppleEvent
The Apple event whose handling is to be suspended. Although the Apple Event Manager doesn't need this parameter to identify the Apple event currently being handled, providing it is a safeguard that you are suspending the correct Apple event.
DESCRIPTION
After a server application makes a successful call to the AESuspendTheCurrentEvent function, it is no longer required to return a result or a reply for the Apple event that was being handled. It can, however, return a result if it later calls the AEResumeTheCurrentEvent function to resume event processing.

The Apple Event Manager does not automatically dispose of Apple events that have been suspended or their default replies. (The Apple Event Manager does, however, automatically dispose of a previously suspended Apple event and its default reply if the server later resumes processing of the Apple event by calling the AEResumeTheCurrentEvent function.) If your server application does not resume processing of a suspended Apple event, it is responsible for using the AEDisposeDesc function to dispose of both the Apple event and its default reply when your application has finished using them.

SPECIAL CONSIDERATIONS
If your application suspends handling of an Apple event it sends to itself, the Apple Event Manager immediately returns from the AESend call with the error code errAETimeout, regardless of whether the kAEQueueReply, kAEWaitReply, or kAENoReply flags were set, even if the timeout parameter is set to kNoTimeOut. The routine calling AESend should take the timeout error as confirmation that the event was sent.

As with other calls to AESend that return a timeout error, the handler continues to process the event nevertheless. The handler's reply, if any, is provided in the reply event when the handling is completed. The Apple Event Manager provides no notification that the reply is ready. If no data has yet been placed in the reply event, the Apple Event Manager returns errAEReplyNotArrived when your application attempts to extract data from the reply.

RESULT CODE
noErr0No error

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996