Important: The information in this document is obsolete and should not be used for new development.
GetCurrentProcess
Use theGetCurrentProcessfunction to get information about the current process,
if any.
FUNCTION GetCurrentProcess (VAR PSN: ProcessSerialNumber): OSErr;
PSN- On output, the process serial number of the current process.
DESCRIPTION
TheGetCurrentProcessfunction returns, in thePSNparameter, the process serial number of the process that is currently running, that is, the one currently accessing the CPU. This is the application associated with theCurrentA5global variable. This application can be running in either the foreground or the background.Applications can use this function to find their own process serial number. Drivers can use this function to find the process serial number of the current process. You can use the returned process serial number in other Process Manager routines.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetCurrentProcessfunction are
Trap macro Selector _OSDispatch $0037 RESULT CODE
noErr 0 No error