Modify

Opened 17 years ago

Closed 17 years ago

#803 closed Feature Request (Rejected)

ProcessGetStats documentation Improvement

Reported by: Emiel Wieldraaijer Owned by:
Milestone: Component: Documentation
Version: Severity: None
Keywords: ProcessGetStats Cc:

Description

Hi,

i want to retrieve some information about the processes running on my computer but i the help file regarding ProcessGetStats did not tell me much..so i decided to figure it out myself..

Here is my example code for the help file

#include <Process.au3>

Dim $Priority[6]

$Priority[0] = "Idle/Low" 
$Priority[1] = "Below Normal"
$Priority[2] = "Normal"
$Priority[3] = "Above Normal"
$Priority[4] = "High"
$Priority[5] = "Realtime"

$List = ProcessList()

$TotalProcesses = $List[0][0]

Msgbox (0, "Total processes detected: ", $TotalProcesses)

; Skip the first detection because it represents the none active systemprocesses PID = 0
for $i = 2 to $List[0][0]
	$MemoryStats = ProcessGetStats ($List[$i][1], 0)
	; Check if a process is an array because not all processes return information
	If IsArray($MemoryStats) Then
		Msgbox (0, "ProcessStats : ", "ProcessName = " & $List[$i][0] & " - MemoryUsage = "  & Round($MemoryStats[0]/1024) & " KB - PID = " & $List[$i][1] & " - Priority = " & $Priority[(_ProcessGetPriority ($List[$i][1]))] ,0)
	Else 
		$TotalProcesses = $TotalProcesses -1 
	EndIf
Next

Msgbox (0, "Total processes returning information: ", $TotalProcesses)

Attachments (0)

Change History (2)

comment:1 by TicketCleanup, 17 years ago

Version: 3.3.0.0

Automatic ticket cleanup.

comment:2 by Valik, 17 years ago

Resolution: Rejected
Status: newclosed

I think the example we have is fine. We only need to show basic usage and give people an idea how a function works. They need to be able to read the documentation to figure out the rest.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.