using SHDocVw; using System; using System.IO; using System.Linq; namespace QVCopier.Utility { internal static class ExplorerAccessor { public static string[] GetOpenedWindowPath() { var paths = new ShellWindows().Cast() .Where(p => p.FullName?.ToLower().EndsWith("explorer.exe") == true && false == string.IsNullOrWhiteSpace(p.LocationURL)) .Select(p => Path.GetFullPath(Uri.UnescapeDataString(new Uri(p.LocationURL).AbsolutePath))) .Distinct() .ToArray(); return paths; } } }