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


GetNextProcess

Use the GetNextProcess function to get information about the next process, if any, in the Process Manager's internal list of open processes.

FUNCTION GetNextProcess (VAR PSN: ProcessSerialNumber): OSErr;
PSN
On input, the process serial number of a process. This number should be a valid process serial number returned from LaunchApplication, GetNextProcess, GetFrontProcess, or GetCurrentProcess, or else the defined constant kNoProcess. On output, the process serial number of the next process, or else kNoProcess.
DESCRIPTION
The Process Manager maintains a list of all open processes. You can derive this list by using repetitive calls to GetNextProcess. Begin generating the list by calling GetNextProcess and specifying the constant kNoProcess in the PSN parameter. You can then use the returned process serial number to get the process serial number of the next process. Note that the order of the list of processes is internal to the Process Manager. When the end of the list is reached, GetNextProcess returns the constant kNoProcess in the PSN parameter and the result code procNotFound.

You can use the returned process serial number in other Process Manager routines. You can also use this process serial number to specify a target application when your application sends a high-level event.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the GetNextProcess function are
Trap macro Selector
_OSDispatch$0038

RESULT CODES
noErr0No error
paramErr-50Process serial number is invalid
procNotFound-600No process in the process list following the specified process


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996