diff --git a/NK2Tray/Properties/AssemblyInfo.cs b/NK2Tray/Properties/AssemblyInfo.cs index 4c4bf81..bc6ac69 100644 --- a/NK2Tray/Properties/AssemblyInfo.cs +++ b/NK2Tray/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.9.0")] -[assembly: AssemblyFileVersion("0.0.9.0")] +[assembly: AssemblyVersion("0.0.10.0")] +[assembly: AssemblyFileVersion("0.0.10.0")] diff --git a/NK2Tray/SessionAndMeta.cs b/NK2Tray/SessionAndMeta.cs index e8a4206..5a243ac 100644 --- a/NK2Tray/SessionAndMeta.cs +++ b/NK2Tray/SessionAndMeta.cs @@ -1,6 +1,7 @@ using NAudio.CoreAudioApi; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace NK2Tray @@ -40,12 +41,14 @@ public static List GetSessionMeta(ref SessionCollection sessions foreach (var ident in sessionsByIdent.Keys.ToList()) { Console.WriteLine("Working on " + ident); - var ordered = sessionsByIdent[ident].OrderBy(i => i.GetSessionInstanceIdentifier.Split('|').Last().Split('b').Last()).ToList(); + //var ordered = sessionsByIdent[ident].OrderBy(i => i.GetSessionInstanceIdentifier.Split('|').Last().Split('b').Last()).ToList(); + var ordered = sessionsByIdent[ident].OrderBy(i => (int)Process.GetProcessById((int)i.GetProcessID).MainWindowHandle).ToList(); bool dup = ordered.Count > 1; for (int i = 0; i < ordered.Count; i++) { outSessions.Add(new SessionAndMeta(ordered[i], dup, i)); - Console.WriteLine("" + i + ordered[i].GetSessionInstanceIdentifier); + var process = Process.GetProcessById((int)ordered[i].GetProcessID); + Console.WriteLine("" + i + " - " + ordered[i].GetSessionInstanceIdentifier + " - " + process.MainWindowTitle + " - " + (int)process.MainWindowHandle); } }