Link to home
Start Free TrialLog in
Avatar of FIIS-VSO
FIIS-VSO

asked on

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!
Avatar of CDCOP
CDCOP

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
Next
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial