Results 1 to 8 of 8

Thread: [RESOLVED]Get a List of Running Processes

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2013
    Posts
    25

    [RESOLVED]Get a List of Running Processes

    I am making a program which shows all system information , and inside a Richtextbox I would like it to show list of running processes. However I would like to dim the entire list , so for example :

    Code:
    Dim processes as String
    
    processes =  (code to get list of running processes)
    then I could display it easily in a message box or in a textbox

    Code:
    Msgbox(processes) 
    textbox1.text = processes
    Hope any of this makes sense.
    Last edited by trueboss926; Oct 17th, 2013 at 06:25 AM.

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Get a List of Running Processes

    I have to ask, have you done a Google search. I literally had 1000s of Answers searching for ".net list processes". You should find examples using this method: http://msdn.microsoft.com/en-us/library/1f3ys1f9.aspx
    Last edited by Grimfort; Oct 16th, 2013 at 02:30 PM.

  3. #3
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    637

    Re: Get a List of Running Processes


  4. #4
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Get a List of Running Processes

    Hi

    another addition...

    using a messagebox is likely going to end up with a box so big it doesnt fit on the screen, look into using a custom form with a listbox so your can scroll through and keep the ui tidy, and there is no point putting it into a string as it comes in a list anyway, just put it straight to the listbox.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2013
    Posts
    25

    Re: Get a List of Running Processes

    Quote Originally Posted by Grimfort View Post
    I have to ask, have you done a Google search. I literally had 1000s of Answers searching for ".net list processes". You should find examples using this method: http://msdn.microsoft.com/en-us/library/1f3ys1f9.aspx
    Okay I looked and tried the following code, for a button event:

    Code:
      
     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Dim localAll As Process() = Process.GetProcesses()
            MsgBox(localAll.ToString)
        End Sub
    The message box displays "System.Diagostics.Process[]" . In my case I want to incorporate the list into a richtextbox. I used a messagebox as an example to see if it would display correctly. Since messagebox shows just plain text, I tried to display it on richtextbox but instead it shows the same message.
    Last edited by trueboss926; Oct 16th, 2013 at 03:46 PM.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2013
    Posts
    25

    Re: Get a List of Running Processes

    Quote Originally Posted by BenJones View Post
    As I said , I would like to put them inside a richtextbox format.
    Last edited by trueboss926; Oct 16th, 2013 at 03:41 PM.

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Get a List of Running Processes

    Quote Originally Posted by trueboss926 View Post
    As I said , I would like to put them inside a richtextbox format.
    Process has many properties, if you just want to list their names in a RTB you could try something like,

    Code:
    Dim procNames As String = String.Empty
    Dim localAll As Process() = Process.GetProcesses()
    For Each p In localAll
        procNames &= p.ProcessName & Environment.NewLine
    Next
    RichTextBox1.Text = procNames

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Aug 2013
    Posts
    25

    Re: Get a List of Running Processes

    Thanks it is exactly how I described.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width