C# : How to get most recently used instance from multiple running instances of my WPF application?

221 views Asked by At

If there are multipple running applications, I need to get the most recently used. I know that I can find all running instances of my app using Process, but how to find from this list most recently used instance?

2

There are 2 answers

2
Deepak Bhatia On

Use Process.StartTime Property of Process class to know which instance started most recently.

0
Mirzodaler Ataev On

I found other solution using Z-Order window How to get the z-order in windows?