• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

Search the list of processes running in XP

I'm building a program plug-in that requires me to perform checks on the program upon application start-up. The problem is that I only want to perform these checks if the program is currently running.

In order to check to see if the program is running, the only solution I can think of is searching the image names of the processes that are running for an instance of the program. (Like the "Image Names" under the "Processes" tab of the Windows Task Manager)

If anyone could help me with any hints on how to go about doing this, it'd be greatly appreciated! 300 points to a good example!

P.S. If there's any other way someone can think of to check to see if the program is already running, let me know!
1 Solution
Try this:

'This will output current processes to a textbox named txt_processes

'Declare array to store processes.
Dim ProcessArray As Array

'Insert processes into array
ProcessArray = System.Diagnostics.Process.GetProcesses

'Declare integer for for loop to display each process
Dim i As Integer

For i = 0 To UBound(ProcessArray)
     txt_processes.Text = txt_processes.Text & ProcessArray(i).ToString & vbCrLf

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now