Re: How to get the list of Processes/Applications from "Task Manager" using Autoit?
"valery_vi" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Brian!
Absolutely!
#include <GuiConstants.au3>
dim $Table, $list
GuiCreate("Processes", 300, 400, (@DesktopWidth-300)/2,
(@DesktopHeight-400)/2, $WS_OVERLAPPEDWINDOW, $WS_EX_TOPMOST)
$Table = GuiCtrlCreateListView ('Process Name | Pid',10,10,280,380)
; List all processes
$list = ProcessList()
for $i = 1 to $list[0][0]
GuiCtrlCreateListViewItem($list[$i][0] & ' | ' & $list[$i][1],
$Table)
next
GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
Valery
--- In [email protected], "brian_keene@..."
<brian_keene@...> wrote:
>
> > From: "white.gold09" <white.gold09@...>
> > To: [email protected]
> > Subject: [AutoIt] How to get the list of Processes/Applications
> > from "Task Manager" using Autoit?
> > Date: Mon, Dec 04, 2006 05:55 PM
> > -----------------------------------------------------------------
----
> >
> > I want to get the list of Applications/Processes currently
running in
> > the system using Task Manager's Applications/Processes tab. Any
ideas
> > as to how to do this using Autoit?
>
> Why not use the "ProcessList" built-in function? See help file
> description below.
>
> Regards
> Brian Keene
>
> Function Reference
> ProcessList
> -------------------------------------------------------------------
----
> Returns an array listing the currently running processes (names
and
> PIDs).
> ProcessList( ["name"] )
>
> Parameters
> name [Optional] If a name is given only processes of the same name
> will be returned.
>
> Return Value
> Success: An array of process names and PIDs (See Remarks).
> Failure: @error is set to 1.
>
> Remarks
> The array returned is two-dimensional and is made up as follows:
> $array[0][0] = Number of processes
> $array[1][0] = 1st Process name
> $array[1][1] = 1st Process ID (PID)
> $array[2][0] = 2nd Process name
> $array[2][1] = 2nd Process ID (PID)
> ...
> $array[n][0] = nth Process name
> $array[n][1] = nth Process ID (PID)
>
> Related
> ProcessClose, ProcessExists, ProcessSetPriority, ProcessWait,
> ProcessWaitClose
>
> Example
> ; List all processes
> $list = ProcessList()
> for $i = 1 to $list[0][0]
> msgbox(0, $list[$i][0], $list[$i][1])
> next
>
> ; List just notepad.exe processes
> $list = ProcessList("notepad.exe")
> for $i = 1 to $list[0][0]
> msgbox(0, $list[$i][0], $list[$i][1])
> next
>
>
>
> [Non-text portions of this message have been removed]
>