1

How can I get the processes shown in taskbar because the way of getting the list from taskmanager is not suitable for my task.

Thanks in advance,

Inaa Inzii
  • 121
  • 1
  • 4
  • 14
  • 2
    Possible duplicate of http://stackoverflow.com/questions/1366321/how-to-get-the-process-names-of-applications-in-taskbar-using-c – Jason Evans Oct 23 '13 at 09:14
  • what you are trying to achieve.to get back only the name of the process or to control like start stop process – Rezoan Oct 23 '13 at 09:17

3 Answers3

0

Have a look at the Windows API CodePack.
Please provide mor details for your exact needs.

weismat
  • 7,195
  • 3
  • 43
  • 58
0

How I would do this is get a list of all of the processes and check each one to see if it has a title. If it does then it must be in the task bar. Something like this should be what you are after. Good luck :)

Process[] allProcesses = Process.GetProcesses();
foreach (Process workingProcess in allProcesses)
{
    if (workingProcess.MainWindowTitle.Length > 0)
    {
        Console.WriteLine(workingProcess.MainWindowTitle);
    }
}

UPDATE: I knew I had looked this up before and read it somewhere but couldn't remember where. Thanks Jason Evans for the link.

How to get the process names of applications in taskbar using c#?

Community
  • 1
  • 1