SameProcess
SameProcess Compare two process serial numbers
OSErr SameProcess(PSN1,PSN2, result);
ProcessSerialNumber *PSN1 ; pointer to first process serial number
ProcessSerialNumber *PSN 2 ; pointer to second process serial number
Boolean *result ; TRUE=same process
returns Error Code; 0=no error
You use SameProcess to compare two process serial numbers and to
determine whether they refer to the same process.
PSN1 is a pointer to a valid process serial number returned from
LaunchApplication , GetNextProcess , GetFrontProcess , or
GetCurrentProcess , or a high level event. You can also use the
constant kCurrentProcess to return to the current process.
PSN2 is a valid process serial number returned from
LaunchApplication , GetNextProcess , GetFrontProcess , or
GetCurrentProcess , or a high level event. You can also use the
constant kCurrentProcess to return to the current process.
result is a pointer to a Boolean value. If the process serial numbers
specified in the PSN1 and PSN2 parameters refer to the same
process, the SameProcess function returns TRUE in the result
parameter; otherwise, it returns FALSE in the result parameter.
Returns: an operating system Error Code.
noErr (0) No error
paramErr (-50) Process serial number is invalid

Notes: When you compare two process serial numbers, use the SameProcess
function rather than any other means, because the interpretation of the bits
in a process serial number is internal to the Process Manager.