Process List in DataGridView

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,
I am basically recreating task manager and process explorer to my needs. I am getting the processes as needed for now into the datagridview by using a timer. However, I cant seem to figure out how to "remove" any copies as it constantly re-adds the processes
on each timer interval.
I basically want to "refresh" the processes in the datagridview, and "update" any information within the rows.
Heres what I got:

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Private <span style="color:Blue; Sub Timer2_Tick(sender <span style="color:Blue; As System.Object, e <span style="color:Blue; As System.EventArgs) <span style="color:Blue; Handles Timer2.Tick

<span style="color:Blue; Dim RunningProcesses <span style="color:Blue; As System.Diagnostics.Process()

RunningProcesses = System.Diagnostics.Process.GetProcesses()

<span style="color:Blue; Dim Proc <span style="color:Blue; As System.Diagnostics.Process

<span style="color:Blue; For <span style="color:Blue; Each Proc <span style="color:Blue; In RunningProcesses
<span style="color:Green; Need to remove duplicates and update these 3 rows.
DataGridView1.Rows.Add(Proc.ProcessName & <span style="color:#A31515; ".exe", Proc.SessionId, Proc.Id)
<span style="color:Blue; Next
<span style="color:Blue; End <span style="color:Blue; Sub
[/code]

<br/>
Thanks,
- Jordan <hr class="sig <span style="font-family:Verdana; font-size:small <span style="color:green If you find an answer helpful, click the
helpful button. If you find an answer to your question, mark it as the answer.
Jordan St. Godard | Microsoft <span style="color:rgb(80,185,72) Community Contributor 2011 <br/>
http://www.metasdevelopment.com Metas Development <br/>
<br/>
Helpful Links:<br/>


<span style="font-style:normal http://bit.ly/vSuwtc Visual Basic for Applications (VBA)
<span style="font-style:normal http://bit.ly/rWxgLF Visual Basic 6 (VB6)
<span style="font-style:normal http://bit.ly/faPot Visual Basic Script (VBS)
<span style="font-style:normal http://bit.ly/FcoL Convert C# to VB



View the full article
 
Back
Top