Reputation: 4066
I'm using Delphi XE and would like to add "recent items" in the Windows 7 taskbar jump list for my application, like when right-clicking on Microsoft Word brings up recently opened documents. I've found information on how to set the progress but nothing on jump-list items. Any help would be greatly appreciated.
Upvotes: 4
Views: 4121
Reputation: 108948
This will happen automatically if, for instance, you only use the standard Windows file dialogs. At least my text editor, Rejbrand Text Editor, has got such a MRU list by Windows. It lists all files I have recently edited using Rejbrand Text Editor, even though I have not written any code at all for it.
I think that Windows observes the files you
yourapp.exe <file name>
, for instance by double-clicking a file that opens in your applicationand automatically display these in the list.
If you want to control the task bar button and menu programmatically, you can use the Windows API. Delphi-specific examples are found in this blog post.
Upvotes: 7
Reputation: 417
Here are some resources that I have found useful when making my programs vista ready
http://code.google.com/p/theunknownones/wiki/TaskbarListComponents http://www.installationexcellence.com/articles/VistaWithDelphi/Index.html http://www.theabsolute.net/sware/delphivista.html
Upvotes: 1
Reputation: 612934
In my opinion the best way to do this is to make the following simple API call:
SHAddToRecentDocs(SHARD_PATH, PChar(FileName));
This not only deals with Windows 7 jump lists but also adds your file into the system's list of recently used documents which has an effect on early versions of Windows too.
Call the function whenever you open or save a file.
For your convenience, a link to the documentation of SHAddToRecentDocs()
.
Upvotes: 4