Vcl.JumpList.TCustomJumpList.AddToRecent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class procedure AddToRecent(const Path: string); overload; inline;
class procedure AddToRecent(const ShellLink: IShellLink); overload; inline;
class procedure AddToRecent(const JumpItem: TJumpListItem); overload; inline;

C++

__classmethod void __fastcall AddToRecent(const System::UnicodeString Path)/* overload */;
__classmethod void __fastcall AddToRecent(const _di_IShellLinkW ShellLink)/* overload */;
__classmethod void __fastcall AddToRecent(TJumpListItem* const JumpItem)/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.JumpList.pas
Vcl.JumpList.hpp
Vcl.JumpList TCustomJumpList

Description

Adds the specified file to the list of files that your application has used recently and to the list of files that your application has used often.

You can specify the target file as any of the following:

  • A string containing a file path. For example: "C:\Users\User\Documents\MyDocument.txt".
  • An instance of TJumpListItem.
  • An instance of a class that implements the IShellLink interface.
JumpListsRecentListMyDocument.png

Windows only shows lists of recent and frequent files if your application is configured as being able to open one or more file types. For example, if your user selects your application as a valid application to open some file type, even if your application is not the default application to open that file type, your application can show recent and frequent files on the task bar. Once your application is configured as being able to open one or more file types, you can add files of any type to the lists of recent and frequent files of your application.

Windows only shows the list of recent files by default. To show the list of frequent files instead, enable the ShowFrequent property. Microsoft recommends showing only one of these lists, however you can show both lists if you want to. To show both lists enable both the ShowRecent and the ShowFrequent properties.

When your application opens a file using the TOpenDialog component, the opened file is automatically added to the lists of recent and frequent files. You do not need to call AddToRecent manually to register files that your user opens using TOpenDialog.

Exceptions

AddToRecent calls GetAsIShellLink on JumpItem. GetAsIShellLink may raise some exceptions.

See Also