0

I have a small program idea that I've been trying to execute for months but I've hit a dead end with this small thing.

I'm looking for a way to detect a certain process running through task manager and then get its path, and I've found a way to do so.

Process currentProsseses = Process.GetCurrentProcess();
        Process[] list = Process.GetProcessesByName("steam");            
        foreach (var process in list)
        {
            string fullPath = process.MainModule.FileName;
            MessageBox.Show(fullPath);
        }

The problem is I need to make my program listen for the process so it detects it as soon as it runs, but I haven't found any way to loop it without crashing or failing, I know it's a small matter and that's why it's driving me nuts.

jps
  • 15,760
  • 14
  • 59
  • 71
Don
  • 1

0 Answers0