1234567891011121314151617181920 |
- 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<InternetExplorer>()
- .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;
- }
- }
- }
|