Ejemplo n.º 1
0
        public static IShellFolder GetPidlCloneFolder(PidlClone pidlClone)
        {
            int          hr            = 0;
            IShellFolder desktopFolder = PidlFolderData.DesktopFolder;
            var          pidlTmp       = pidlClone.Handle;

            IntPtr folderTmpPtr = IntPtr.Zero;

            if ((hr = desktopFolder.BindToObject(pidlTmp, IntPtr.Zero,
                                                 ref Shell32.IID_IShellFolder,
                                                 out folderTmpPtr)) != WinError.S_OK)
            {
                return(null);
            }

            return(Marshal.GetObjectForIUnknown(folderTmpPtr) as IShellFolder);
        }