Important: The information in this document is obsolete and should not be used for new development.
GetProcessInformation
Use theGetProcessInformationfunction to get information about a specific process.
FUNCTION GetProcessInformation (PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
PSN- The process serial number of a process. This number should be a valid process serial number returned from
LaunchApplication,GetNextProcess,GetFrontProcess,GetCurrentProcess, or else a high-level event. You can use the constantkCurrentProcessto get information about the current process.info- A record containing information about the specified process.
DESCRIPTION
TheGetProcessInformationfunction returns, in a process information record, information about the specified process. The information returned in theinfoparameter includes the application's name as it appears in the Application menu, the type and signature of the application, the address of the application partition, the number of bytes in the application partition, the number of free bytes in the application heap, the application that launched the application, the time at which the application was launched, and the location of the application file. See "Getting Information About Other Processes" on page 2-5 for the structure of the process information record.The
GetProcessInformationfunction also returns information about the application's'SIZE'resource and indicates whether the process is an application or a desk accessory.You need to specify values for the
processInfoLength,processName, andprocessAppSpecfields of the process information record. Specify the length of the process information record in theprocessInfoLengthfield. If you do not want information returned in theprocessNameandprocessAppSpecfields, specifyNILfor these fields. Otherwise, allocate at least 32 bytes of storage for the string pointed to by theprocessNamefield and, in theprocessAppSpecfield, specify a pointer to anFSSpecrecord.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetProcessInformationfunction are
Trap macro Selector _OSDispatch $003A SPECIAL CONSIDERATIONS
Do not callGetProcessInformationat interrupt time.RESULT CODES
noErr 0 No error paramErr -50 Process serial number is invalid