Search the list of processes running in XP

Posted on 2006-04-05
Last Modified: 2010-04-23
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!
Question by:FIIS-VSO
    LVL 9

    Expert Comment

    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
    LVL 48

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now