GetProcessInformation
GetProcessInformation Get information about the specified process
ProcessSerialNumber *PSN ; a pointer to a valid process serial number
ProcessInfoRecPtr info ; a pointer to a ProcessInfoRec
returns Error Code; 0=no error
You use the GetProcessInformation to get information about the specified
process in a process information record.
PSN is a valid process serial number returned from
LaunchApplication , GetNextProcess , GetFrontProcess , or
GetCurrentProcess , or a high level event. You can use the
constant kCurrentProcess to get information about the current
process.
info is a pointer to a ProcessInfoRec which 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.
Returns: an operating system Error Code.
noErr (0) No error
paramErr (-50) Process serial number is invalid

Notes: GetProcessInformation function returns information about the
specified process in a process information record.
The GetProcessInformation function 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 , and
processAppSpec fields of the process information record. Specify the
length of the process information record in the processInfoLength field. If
you do not want information returned in the processName and
processAppSpec fields, specify NIL for these fields. Otherwise, allocate at
least 32 bytes of storage for the string pointed to by the processName field
and specify a pointer to an FSSpec record in the processAppSpec field.
The process serial number you specify in the PSN parameter should be a
valid process serial number returned from LaunchApplication ,
GetNextProcess , GetFrontProcess , GetCurrentProcess , or a
high-level event. You can use the constant kCurrentProcess to get
information about the current process.
Note: Do not call GetProcessInformation from a routine that executes
at interrupt time.