PA_GetProcessInfo

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetProcessInfo (pNum; pName; pState; pTime)

ParameterTypeDescription
pNumlongProcess number
pNamechar *Process name
pStatelong *Process state
pTimelong *Process state

Description

The routine PA_GetProcessInfo returns information on the process whose number is passed in pNum.

This works exactly like the PROCESS PROPERTIES command, except for the optional 4th Dimension command argument that is not handled by the routine (visible, unique ID, origin).

The pState parameter may contain the same values as 4th Dimension constants:

ConstantValue
Aborted-1
Delayed1
Does not exist-100
Executing0
Hidden modal dialog6
Paused5
Waiting for input output3
Waiting for internal flag4
Waiting for user event2

Please refer to the 4th Dimension documentation to learn more about PROCESS PROPERTIES.

Example

Count the paused processes (process state is 5).

   long CountPausedProcesses()
   {
      char         name[256];
      long         i, state, time, totCount, pausedCount;
      
      pausedCount = 0;
      totCount = PA_CountTotalProcess();
      for(i = 1; i <= totCount; i++)
      {
         state = 0;
         PA_GetProcessInfo(i, name, &state, &time);
         if(state == 5)
            pausedCount++;
      }
      
      return pausedCount;
   }

See Also

PA_CountTotalProcess, PROCESS PROPERTIES.

Error Handling

Use PA_GetLastError to see if an error occurred


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next