News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

Add documents to "Start | Documents" menu

Started by charleychacko, October 15, 2006, 12:15:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

charleychacko

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' );