Important: The information in this document is obsolete and should not be used for new development.
GetNextProcess
Use theGetNextProcessfunction 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, orGetCurrentProcess, or else the defined constantkNoProcess. On output, the process serial number of the next process, or elsekNoProcess.DESCRIPTION
The Process Manager maintains a list of all open processes. You can derive this list by using repetitive calls toGetNextProcess. Begin generating the list by callingGetNextProcessand specifying the constantkNoProcessin thePSNparameter. 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,GetNextProcessreturns the constantkNoProcessin thePSNparameter and the result codeprocNotFound.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 theGetNextProcessfunction are
Trap macro Selector _OSDispatch $0038 RESULT CODES
noErr 0 No error paramErr -50 Process serial number is invalid procNotFound -600 No process in the process list following the specified process