BExplorer.Shell.Interop.KnownFolderManagerClass.FindFolderFromPath C# (CSharp) Method

FindFolderFromPath() private method

private FindFolderFromPath ( [ path, [ mode, [ knownFolder ) : void
path [
mode [
knownFolder [
return void
		public virtual extern void FindFolderFromPath(
				[In, MarshalAs(UnmanagedType.LPWStr)] string path,
				[In] int mode,
				[Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);

Usage Example

        /*
		/// <summary>
		/// Returns a known folder given its shell path, such as <c>C:\users\public\documents</c> or 
		/// <c>::{645FF040-5081-101B-9F08-00AA002F954E}</c> for the Recycle Bin.
		/// </summary>
		/// <param name="path">The path for the requested known folder; either a physical path or a virtual path.</param>
		/// <returns>A known folder representing the specified name.</returns>
		public static IKnownFolder FromPath(string path) {
			return KnownFolderHelper.FromParsingName(path);
		}
		*/

        /// <summary>
        /// Returns a known folder given its shell namespace parsing name, such as 
        /// <c>::{645FF040-5081-101B-9F08-00AA002F954E}</c> for the Recycle Bin.
        /// </summary>
        /// <param name="parsingName">The parsing name (or path) for the requested known folder.</param>
        /// <returns>A known folder representing the specified name.</returns>
        /// <exception cref="System.ArgumentException">Thrown if the given parsing name is invalid.</exception>
        /// 
        public static IKnownFolder FromParsingNameOnly(string parsingName)
        {
            var k = new KnownFolderManagerClass();
            IKnownFolderNative folder = null;
            k.FindFolderFromPath(parsingName, 0, out folder);
            return (IKnownFolder)folder;
        }