Jump to content

ProcessList()


 Share

Recommended Posts

The _ArrayToString function only supports one dimensional arrays. ProcessList() Returns a two dimensional array.

You could do this to get the same result as _ArrayToString:

Dim $ProcessArray
Dim $ProcessString
Dim $i

$ProcessArray = ProcessList()

For $i = 1 to UBound($ProcessArray) - 1
    $ProcessString = $ProcessString & "|" & $ProcessArray[$i][0]
Next

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

Link to comment
Share on other sites

Which part of it do you want in a string? The PID or the process name?

$myString = ""
  $myArray = ProcessList ()
  
  For $X = 1 to $myArray[0][0]
;Write process names to string seperated by semicolon
  $myString &= $myArray[$X][0] & ";"
  
;Write process pids to string seperated by semicolon
;$myString &= $myArray[$X][1] & ";"
  
  Next
  
  MsgBox(0,"",$myString)

EDIT: You get the idea

Edited by weaponx
Link to comment
Share on other sites

$myString = ""
 $myArray = ProcessList ()
 
 For $X = 1 to $myArray[0][0]
;Write process names to string seperated by semicolon
 $myString &= $myArray[$X][0] & ";"
 
;Write process pids to string seperated by semicolon
;$myString &= $myArray[$X][0] & ";"
 
 Next
 
 MsgBox(0,"",$myString)
the second $myArray[$X][0] should be $myArray[$X][1] :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...