Carbon


ProcessInfoRec

Header: Processes.h

struct ProcessInfoRec {
    UInt32 processInfoLength; 
    StringPtr processName; 
    ProcessSerialNumber processNumber; 
    UInt32 processType; 
    OSType processSignature; 
    UInt32 processMode; 
    Ptr processLocation; 
    UInt32 processSize; 
    UInt32 processFreeMem; 
    ProcessSerialNumber processLauncher; 
    UInt32 processLaunchDate; 
    UInt32 processActiveTime; 
    FSSpecPtr processAppSpec;
};
typedef ProcessInfoRec ProcessInfoRecPtr;

Field descriptions

processInfoLength

The number of bytes in the process information structure. For compatibility, you should specify the length of the structure in this field.

processName

The name of the application or desk accessory. For applications, this field contains the name of the application as designated by the user at the time the application was opened. For example, for foreground applications, the processName field contains the name as it appears in the Application menu. For desk accessories, the processName field contains the name of the 'DRVR' resource. You must specify NULL in the processName field if you do not want the application name or the desk accessory name returned. Otherwise, you should allocate at least 32 bytes of storage for the string pointed to by the processName field. Note that the processName field specifies the name of either the application or the 'DRVR' resource, whereas the processAppSpec field specifies the location of the file.

processNumber

The process serial number. The process serial number is a 64-bit number; the meaning of these bits is internal to the Process Manager. You should not attempt to interpret the value of the process serial number.

processType

The file type of the application, generally 'APPL' for applications and 'appe' for background-only applications launched at startup. If the process is a desk accessory, this field specifies the type of the file containing the 'DRVR' resource.

processSignature

The signature of the file containing the application or the 'DRVR' resource (for example, the signature of the TeachText application is 'ttxt').

processMode

Process mode flags. These flags indicate whether the process is an application or desk accessory. For applications, this field also returns information specified in the application’s 'SIZE' resource. This information is returned as flags. You can refer to these flags by using the constants described in “Process Mode Flag Constants”:

processLocation

The beginning address of the application partition.

processSize

The number of bytes in the application partition (including the heap, stack, and A5 world).

processFreeMem

The number of free bytes in the application heap.

processLauncher

The process serial number of the process that launched the application or desk accessory. If the original launcher of the process is no longer open, this field contains the constant kNoProcess.

processLaunchDate

The value of the Ticks global variable at the time that the process was launched.

processActiveTime

The accumulated time, in ticks, during which the process has used the CPU, including both foreground and background processing time.

processAppSpec

The address of a file specification structure that stores the location of the file containing the application or 'DRVR' resource. You should specify NULL in the processAppSpec field if you do not want the FSSpec structure of the file returned.

The GetProcessInformation function returns information in a process information structure, which is defined by the ProcessInfoRec data type.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)