'How do I get the name of each item in windows 10 'quick access' items list and put it on a list?

In Windows 10 or possibly lesser windows versions, there is a 'quick access' icon that shows up when you have documents folder open on the left side. I just want to get the names of each item in that 'quick access' list and put it .ToList();, how do I do this?
PS, I'm not trying to add a folder to quick access like the other answered questions in these links: Is it possible programmatically add folders to the Windows 10 Quick Access panel in the explorer window?

How to programmatically add a folder to Favorites in Windows File Explorer

I'm trying to get the names of each item on that panel, not add folders to it.

windows quick access



Solution 1:[1]

Here is some code that dumps it to the console:

// get this: https://docs.microsoft.com/en-us/windows/win32/shell/shell-application
dynamic shell = Activator.CreateInstance(Type.GetTypeFromProgID("Shell.Application"));

// this is Quick Access folder id
var CLSID_HomeFolder = new Guid("679f85cb-0220-4080-b29b-5540cc05aab6");
var quickAccess = shell.Namespace("shell:::" + CLSID_HomeFolder.ToString("B"));
foreach (var item in quickAccess.Items())
{
    var grouping = (int)item.ExtendedProperty("System.Home.Grouping");
    switch (grouping)
    {
        case 1:
            Console.WriteLine("Frequent: " + item.Name + " path: " + item.Path);
            break;

        case 2:
            Console.WriteLine("Recent: " + item.Name + " path: " + item.Path);
            break;

        default:
            Console.WriteLine("Unspecified: " + item.Name + " path: " + item.Path);
            break;
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Simon Mourier