I am sure I would do this, but the way I am thinking how to achieve this makes me sad, so I am asking for better way
List<Process> myList = new List<Process>();
Process[] processlist = Process.GetProcesses(); // Load all existing processes
// Pin existing sessions to the application
foreach (Process p in processlist)
{
if (p.MainWindowTitle.Contains("TX")) // schema is like TX1 => TX10, but this loop is not sorted at all
{
myList.Add(p); // Unsorted list when looking by MainWindowTitle property
}
}
Sorry fot nor precising the question about what kind of sorting I want to achieve
[0] TX1
[1] TX2
...
[5] TX6
etc.