Beispiel #1
0
            public PidlHelper(PidlHelper parent, string path)
            {
                var IID_IShellFolder = typeof(IShellFolder).GUID;

                Marshal.ThrowExceptionForHR(
                    parent.ShellFolder.BindToObject(
                        parent.IntPtr,
                        null,
                        ref IID_IShellFolder,
                        out IShellFolder shellFolder));

                uint attr = 0;

                shellFolder.ParseDisplayName(
                    IntPtr.Zero,
                    null,
                    path,
                    out uint pchEaten,
                    out IntPtr ptr,
                    ref attr);

                this.DirOrFile   = path;
                this.ShellFolder = shellFolder;
                this.IntPtr      = ptr;
            }
Beispiel #2
0
 public static void OpenAndSelect(string parentDirectory, IEnumerable <string> names)
 {
     using (var pidl = new PidlHelper(parentDirectory))
         pidl.Open(names);
 }
Beispiel #3
0
 public static void OpenAndSelect(string path)
 {
     using (var pidl = new PidlHelper(path))
         pidl.Open(null);
 }