Hi i need to get all running application not process and then list it in a listview
Thank you but by the way can any one tell me how can i do an action to the selected element of a listview on buttonclick
thank you all again this will help me alot

6 Years
Discussion Span
Last Post by thines01

This isn't ListView code, but it will help:

While quickly looking into this, I noticed ONE difference between running applications and running processes is that the applications have Window Titles.
There is probably some other quality, but that's the first thing I saw.

So, looping through the processes that have Window Titles will get the applications.

Consider this:

using System;
using System.Diagnostics;
using System.Linq;

namespace DW_405589_CS_CON
   class Program
      static void Main(string[] args)
         foreach (Process proc in Process.GetProcesses().Where(p => !string.IsNullOrEmpty(p.MainWindowTitle)))
               string.Format("{0}({1})", proc.MainWindowTitle, proc.ProcessName));

Which will show the applications in the output window.

Putting them in a listview would not be difficult.

Next, once you've narrowed down just the ones you need, you can access the methods on each of those apps (like Kill() and Start())

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.