예제 #1
0
        /// <summary>
        /// Returns the native known folder (IKnownFolderNative) given a PID list
        /// </summary>
        /// <param name="pidl"></param>
        /// <returns></returns>
        internal static IKnownFolderNative FromPIDL(IntPtr pidl)
        {
            KnownFolderManagerClass knownFolderManager = new KnownFolderManagerClass();

            IKnownFolderNative knownFolder;
            HResult            hr = knownFolderManager.FindFolderFromIDList(pidl, out knownFolder);

            return((hr == HResult.Ok) ? knownFolder : null);
        }
        /// <summary>
        /// Returns the native known folder (IKnownFolderNative) given a PID list
        /// </summary>
        /// <param name="pidl"></param>
        /// <returns></returns>
        internal static IKnownFolderNative FromPIDL(IntPtr pidl)
        {            
            KnownFolderManagerClass knownFolderManager = new KnownFolderManagerClass();
            
            IKnownFolderNative knownFolder;
            HResult hr = knownFolderManager.FindFolderFromIDList(pidl, out knownFolder);

            return (hr == HResult.Ok) ? knownFolder : null;
        }