Using the Process Manager
application (or desk accessory, if it is not opened in the context of an
application). The process serial number is unique to each process on the local
machine and is valid for a single boot of the machine. You can use the process
serial number to specify a particular process for most of the
Opening or Printing Files Based on Finder Information
When a user opens or prints a file from the Finder, the Finder uses the
Process Manager to launch the application that created the file. The Finder sets up the information your application can use to determine which files to
open or print. The Finder information includes a list of files to open or print.
In version 7.0, applications that support high-level events (that is, that have
the isHighLevelEventAware flag set in the 'SIZE' resource) receive the Finder
your application processes Apple events to open or print files.
Applications that do not support high-level events can use the
GetAppParms routine to get the Finder information. See the section called, Getting Information About Other Processes
number of the process that is currently executing. The current process is the
process whose A5 world is currently valid; this process can be in the
process serial number of the foreground process. For example, if your process
which process is in the foreground.
the process serial number of a process currently in the list and use
GetNextProcess to get the process serial number of the next process in the list. The interpretation of the value of a process serial number and the order
When specifying a particular process, use only a process serial number
special processes.
kNoProcess //process does not exist
kSystemProcess //process belongs to OS
kCurrentProcess //the current process
process that does not exist, the constant kSystemProcess refers to a process
belonging to the Operating System, and the constant kCurrentProcess refers to
the current process.
To begin enumerating a list of processes, use the GetNextProcess function and specify the constant kNoProcess as the parameter to return the process
serial number of the first process in the list. You can use the returned process
serial number to get the process serial number of the next process in the list.
code procNotFound at the end of the list.
You can also use a process serial number to specify a target application when
your application sends a high-level event. See the Event Manager for information on how to use a process serial number when your application
sends a high-level event.
about any process, including your own. For example, for a specified process,
you can find the application's name as it appears in the Application menu, the
type and signature of the application, the number of bytes in the application
partition, the number of free bytes in the application heap, the application that
launched the application, and other information.
requested process in a process information record. The process information
// Searching for a specific process
// Assuming inclusion of
aFSSpecPtr)
{
process->highLongOfPSN = 0;
process->lowLongOfPSN = kNoProcess; // start from the beginning
infoRec-> processAppSpec = aFSSpecPtr;
(infoRec-> processSignature == signature) )
}
} // while
}
The code example shows how you can use the GetNextProcess function with specific process.
The code searches the process list for the application with the specified
signature. For example, you might want to find a specific process in order to
send a high-level event to it.