(page requirements)

Add documents to "Start | Documents" menu

By default, Windows will keep track of the documents that you work with and most of the time add them to your "Start | Documents" menu. If you want to add documents to this list from your program (without any user interaction), here's a simple function that can do just that:

uses ShellAPI, ShlOBJ;

procedure AddToStartDocumentsMenu( 
  sFilePath : string );
begin
  SHAddToRecentDocs( 
    SHARD_PATH, 
    PChar( sFilePath ) );
end;

Now, you can just call AddToStartDocumentsMenu() with the document you want to add. For example:

AddToStartDocumentsMenu( 'c:\windows\MyWork.txt' );

 
 
Applicable Keywords : Delphi, Delphi 2.x, Functions, Windows NT, Windows NT 4.x, Windows, Win32, Windows 95
 
 
 
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor