tListProc

Gets a list of all local running processes.

 

Syntax:

tListProc()

Parameters:

none

Returns:

(i) process list a tab delimited list of process names and IDs.

 

The return value, 'process list' is returned in the following format:

 

[processname|processid]@TAB[processname|processid]

 

Notes:

 

When running under Non-Admin privileges, many processes may be reported as "unknown". This function cannot be used in correlation with the Win32 Networking function wntRunAsUser.

 

tListProc list all processes, including the Idle and CSRSS processes.These processes have access restrictions that prevent user-level code from opening them. You will need to handle the access restriction errors using ErrorMode.

 

On Win95, when run in debug mode from Winbatch Studio WinBatch.EXE doesn't show up in the tproclist or Taskinfo. This is expected behavior.

 

On Windows 95, this function doesn't include 'System Idle process' in the list. This is expected behavior.

 

Example:

AddExtender("WWPRC44I.DLL",0,"WWPRC64I.DLL")
list=tListProc()
process=AskItemlist("Process List",list,@TAB,@UNSORTED,@SINGLE)
; parse off process id
procid=ItemExtract(2,process,"|")
procname=ItemExtract(1,process,"|")
; special handling for processes with
; known 'Access Restrictions'
ErrorMode(@OFF)
ret=tGetProcInfo(procid)
ErrorMode(@CANCEL)
If ret == 0
   err = tGetLastError()
   Message("tGetProcInfo Failed",StrCat("tGetlasterror Returned ",err))
   Exit
EndIf
pfc=ItemExtract(1,ret,@TAB)
pwss=ItemExtract(2,ret,@TAB)
wss= ItemExtract(3,ret,@TAB)
qpppu=ItemExtract(4,ret,@TAB)
qppu=ItemExtract(5,ret,@TAB)
qpnppu= ItemExtract(6,ret,@TAB)
qnppu=ItemExtract(7,ret,@TAB)
pfu=ItemExtract(8,ret,@TAB)
ppfu=ItemExtract(9,ret,@TAB)
STRING=StrCat("PageFaultcount",@TAB,pfc,@CRLF,"PeakWorkingSetSize",@TAB,pwss,@CRLF, "WorkingSetSize",@TAB,wss,@CRLF,"QuotaPeakPagedPoolUsage", @TAB,qpppu,@CRLF,"QuotaPagedPoolUsage",@TAB,qppu,@CRLF)
STRING=StrCat(STRING,"QuotaPeakNonPagedPoolUsage",@TAB,qpnppu,@CRLF, "QuotaNonPagedPoolUsage",@TAB,qnppu,@CRLF,"PagefileUsage", @TAB,pfu,@CRLF,"PeakPagefileUsage",@TAB,ppfu)
Message("Memory info on process %procname%",STRING)
Exit
See Also:

tListMod