jumper77
Member
Hi all. I have been trying to loop through processes and put the process icon and name in a Listview. I actually found the solution here before I (just now) became a member. It was a 2008 post where JohnH was helping out. Here's the code. But it has been modified some....
I have one thing left to figure out. On the double click event of the listview, I need it to return the full path to the exe (contaned in the variable "file" in the above sub) It seems like it should be there based on the code, but I can't find a way to do it. And working with Listviews is an area where I'm pretty weak, lol.
So if you don't mind, could someone tell me how to retrieve the full path from the Listview on the double click event?
Thanks in advance for any help. It IS appreciated!
VB.NET:
Private Sub GetProcesses()
lvProcesses.View = View.Details
lvProcesses.Columns(0).Width = 600
For Each p As Process In Process.GetProcesses
Try
Dim file As String = p.MainModule.FileName
lvProcesses.Items.Add(p.ProcessName, file)
Me.ImageList1.Images.Add(file, Icon.ExtractAssociatedIcon(file))
Catch ex As Exception
End Try
Next
End Sub
I have one thing left to figure out. On the double click event of the listview, I need it to return the full path to the exe (contaned in the variable "file" in the above sub) It seems like it should be there based on the code, but I can't find a way to do it. And working with Listviews is an area where I'm pretty weak, lol.
So if you don't mind, could someone tell me how to retrieve the full path from the Listview on the double click event?
Thanks in advance for any help. It IS appreciated!
Last edited: