noober
noober

Reputation: 4938

Recent pseudo-documents per application in Windows

If you look at Classic Shell Start menu, you see that it has a section for recent applications. Every item in the section can contain popup menu, usually used for displaying recent documents, opened earlier in the application. For instance, the 'Word' item contains all .doc and .docx files recently opened in Word. I know a way to build such list: get all links from the 'Recent' folder and filter out matched documents, by .exe name.

But Classic Shell Start menu also shows popup menu for programs like RDC. For RDC client, namely, it shows a list of recent connections. It seems there is a concept of pseudo-documents in Windows, but I have never heard of it. How to get such list for a random .exe file?

Regards,

Upvotes: 1

Views: 128

Answers (1)

theB
theB

Reputation: 6738

The shell maintains the list of recent documents. SHAddToRecentDocs allows a program to add an item to the list. The item can be:

The key idea from the list and documentation is that the item can be a PIDL, which can represent a fancy kind of 'file'. (What you called a pseudo-document. This is an oversimplification. Read the documentation.)

To obtain the recent files list, use SHGetFolderLocation specifying CSIDL_RECENT and use the returned PIDLIST_ABSOLUTE to iterate the shell items.

If the item is not a file the list can be retrieved through the COM IApplicationDocumentLists which requires an Application User Model ID. This excludes pinned items, for which there is no programmatic access for the same reason that there is no access to the start menu pin list.

There are a lot of caveats to this, which is best explained by the documentation:

(edited to add information about the jump list, and missing IShellLink from the list.)

Upvotes: 4

Related Questions