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: Processes
Chapter 2 - Process Manager / Process Manager Reference
Routines / Getting Process Information


SetFrontProcess

Use the SetFrontProcess function to set the front process.

FUNCTION SetFrontProcess (PSN: ProcessSerialNumber): OSErr;
PSN
The process serial number of the process you want to move to the foreground. This number should be a valid process serial number returned from LaunchApplication, GetNextProcess, GetFrontProcess, GetCurrentProcess, or a high-level event. You can also use the constant kCurrentProcess to refer to the current process.
DESCRIPTION
The SetFrontProcess function schedules the specified process to move to the foreground. The specified process moves to the foreground after the current foreground process makes a subsequent call to WaitNextEvent or EventAvail.

If the specified process serial number is invalid or if the specified process is a background-only application, SetFrontProcess returns a nonzero result code and does not change the current foreground process.

If a modal dialog box is the frontmost window, the specified process remains in the background until the user dismisses the modal dialog box.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SetFrontProcess function are
Trap macro Selector
_OSDispatch$003B

SPECIAL CONSIDERATIONS
Do not call SetFrontProcess interrupt time.

RESULT CODES
noErr0No error
procNotFound-600Process with specified process serial number doesn't exist or process is suspended by high-level debugger
appIsDaemon-606Specified process runs only in the background


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996