Important: The information in this document is obsolete and should not be used for new development.
ExitToShellto terminate your application directly.
ExitToShellprocedure terminates the calling process. The Process Manager removes your application from the list of open processes and performs any other necessary cleanup operations. In particular, all memory in your application partition and any temporary memory still allocated to your application is released. If necessary, the Application Died Apple event is sent to the process that launched your application.
If your application was the foreground process at the time it called
ExitToShell, its name is removed from the Application menu. The Process Manager selects a new foreground process, switches it into the foreground, and propagates the scrap to the new foreground application.
If your application was the last one running and the shell program is not the Finder, the Process Manager displays a dialog box that gives the user the choice of restarting the computer or shutting it down.
SPECIAL CONSIDERATIONSAny trap patches installed by your application are removed immediately by
ExitToShell. They will not affect any trap calls made by
ExitToShellexits, the system global variable
DSErrCodeholds its result code.
SEE ALSOSee "Terminating an Application" on page 2-11 for details on the parameters passed to the Application Died event.