Example #1
0
        internal string GetSubObjectName(IntPtr pidlSub)
        {
            IntPtr strr = Marshal.AllocCoTaskMem(RWinShell.MAX_PATH * 2 + 4);

            Marshal.WriteInt32(strr, 0, 0);
            StringBuilder buf = new StringBuilder(RWinShell.MAX_PATH);

            _face.GetDisplayNameOf(pidlSub, EShgno.InFolder, strr);
            RShlwapi.StrRetToBuf(strr, pidlSub, buf, RWinShell.MAX_PATH);
            Marshal.FreeCoTaskMem(strr);
            return(buf.ToString());
        }
Example #2
0
        internal string GetPathByIShell(IntPtr pidlSub)
        {
            IntPtr strr = Marshal.AllocCoTaskMem(RShell32.MAX_PATH * 2 + 4);

            Marshal.WriteInt32(strr, 0, 0);
            StringBuilder buf = new StringBuilder(RShell32.MAX_PATH);

            _face.GetDisplayNameOf(pidlSub, EShgno.ForAddressBar | EShgno.ForParsing, strr);
            RShlwapi.StrRetToBuf(strr, pidlSub, buf, RShell32.MAX_PATH);
            Marshal.FreeCoTaskMem(strr);
            return(buf.ToString());
        }