Modify

Opened 15 years ago

Closed 15 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 Changed 15 years ago by TicketCleanup

  • Version 3.3.0.0 deleted

Automatic ticket cleanup.

comment:2 Changed 15 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.