Sign in to follow this  

[.net] Can a program detect if another program is running?

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am trying to find a way that my c# winform program can detect if another peice of software is running.I want my program to display when a certain program is active and to hide when its not. Any ideas would be great. Thanks :)

Share this post


Link to post
Share on other sites
Maybe you could check OS's process list from time to time?


System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();

Console.WriteLine("ProcessName:ProcessID");

for (int i = 0; i < myProcesses.Length; i++)
{

string processName = myProcesses[i].ProcessName;

Console.WriteLine("{0}", processName);

}

Console.ReadLine();


Share this post


Link to post
Share on other sites

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this