public static string Resolve(string filename) { ShellLink link = new ShellLink(); ((IPersistFile)link).Load(filename, StgmRead); // TODO: if I can get hold of the hwnd call resolve first. This handles moved and renamed files. // ((IShellLinkW)link).Resolve(hwnd, 0) StringBuilder sb = new StringBuilder(MaxPath); Win32FindDataw data = new Win32FindDataw(); ((IShellLinkW)link).GetPath(sb, sb.Capacity, out data, 0); return(sb.ToString()); }
public static extern bool FindNextFile(IntPtr hFindFile, out Win32FindDataw lpFindFileData);
public static extern IntPtr FindFirstFileW(string lpFileName, out Win32FindDataw lpFindFileData);