function SHAddToRecentDocs seems not working on win10 for folders

Steins 41 Reputation points
2022-12-04T15:10:50.53+00:00

It works well with files, but when i tried add a folder to my Frequent Folder list using SHAddToRecentDocs,
In 'C:\Users\xxx\AppData\Roaming\Microsoft\Windows\Recent', i did find it, but it will not show in file explorer frequent folder list.
I've checked the nf-shlobj_core-shaddtorecentdocs docs, since it says:

'Folders are also accepted by SHAddToRecentDocs, but appear only in the Jump List for the Windows Explorer taskbar button. Folders do not appear in any other application's Jump List.'

Supposed to show in the frequent list, but not.

Am i understood it wrong or there's other things i should do to make it work?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,429 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,307 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,831 Reputation points
    2022-12-05T08:43:07.4+00:00

    Folders are added with "pintohome" command :

    For example :

                using (Process p = new Process())  
                {  
                    p.StartInfo.FileName = "E:\\toto";  
                    p.StartInfo.Verb = "pintohome";                     
                    p.Start();  
                }