How can I get an application's process if more than one instance is open.
var processList= Process.GetProcessesByName("MyProcess"); Example:-
2 chrome browsers are open. In the list of processes in the tast mgr, I have 2 chrome processes. I run an application that starts chrome using some Apis "not through Process.Start("")". Now I have 3 in the Task Mgr porcesses
How can I get the process that my application started, and not the other 2 that were already open ? how can I distinguish between the 3 processes that I will get from the statement above
I tried sorting them based on the TotalProcessorTime property, and get the one with the shortest time, but what if I decided to a open another chrome after that, I will get the wrong process.