468,539 Members | 1,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

Implementing a "Most Recent Files" list

Most applications whose purpose is to work with various types of files
implement a "Most Recent Files" list, where the last, say, four files
accessed by the application can quickly be re-opened by clicking on
the file name in the File menu. Thist list is usually just above the
typical Exit menu item.

I take it there is no "automatic" way of implementing this, that each
application has to have code that manually does this. I have a good
idea how to implement such a list, but it sure would be easier if
there was some automatic way of doing it, similar to the Windows menu
item that shows the current list of mdi child windows.

Any suggestions?

Aug 9 '07 #1
4 3411
On Aug 9, 8:52 am, za...@construction-imaging.com wrote:
Most applications whose purpose is to work with various types of files
implement a "Most Recent Files" list, where the last, say, four files
accessed by the application can quickly be re-opened by clicking on
the file name in the File menu. Thist list is usually just above the
typical Exit menu item.

I take it there is no "automatic" way of implementing this, that each
application has to have code that manually does this. I have a good
idea how to implement such a list, but it sure would be easier if
there was some automatic way of doing it, similar to the Windows menu
item that shows the current list of mdi child windows.

Any suggestions?
Well, you could always switch to C++ and use MFC - it's application
generator includes the Recent Files functionality. :-)

Besides that, I say you write a dll that has the functionality and
just add it to the various projects you need it for. The following
codeproject article might be a useful read:

http://www.codeproject.com/csharp/mru.asp

Thanks,

Seth Rowe

Aug 9 '07 #2
On Aug 9, 7:52 am, za...@construction-imaging.com wrote:
Most applications whose purpose is to work with various types of files
implement a "Most Recent Files" list, where the last, say, four files
accessed by the application can quickly be re-opened by clicking on
the file name in the File menu. Thist list is usually just above the
typical Exit menu item.

I take it there is no "automatic" way of implementing this, that each
application has to have code that manually does this. I have a good
idea how to implement such a list, but it sure would be easier if
there was some automatic way of doing it, similar to the Windows menu
item that shows the current list of mdi child windows.

Any suggestions?
I would use and XML file and store recently accessed files there and
then populate the drop down with that information.

Aug 9 '07 #3
On Aug 9, 7:52 am, za...@construction-imaging.com wrote:
Most applications whose purpose is to work with various types of files
implement a "Most Recent Files" list, where the last, say, four files
accessed by the application can quickly be re-opened by clicking on
the file name in the File menu. Thist list is usually just above the
typical Exit menu item.

I take it there is no "automatic" way of implementing this, that each
application has to have code that manually does this. I have a good
idea how to implement such a list, but it sure would be easier if
there was some automatic way of doing it, similar to the Windows menu
item that shows the current list of mdi child windows.

Any suggestions?
I would use and XML file and store recently accessed files there and
then populate the drop down with that information.

Aug 9 '07 #4
On Aug 9, 9:49 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 9, 8:52 am, za...@construction-imaging.com wrote:
Most applications whose purpose is to work with various types of files
implement a "Most Recent Files" list, where the last, say, four files
accessed by the application can quickly be re-opened by clicking on
the file name in the File menu. Thist list is usually just above the
typical Exit menu item.
I take it there is no "automatic" way of implementing this, that each
application has to have code that manually does this. I have a good
idea how to implement such a list, but it sure would be easier if
there was some automatic way of doing it, similar to the Windows menu
item that shows the current list of mdi child windows.
Any suggestions?

Well, you could always switch to C++ and use MFC - it's application
generator includes the Recent Files functionality. :-)

Besides that, I say you write a dll that has the functionality and
just add it to the various projects you need it for. The following
codeproject article might be a useful read:

http://www.codeproject.com/csharp/mru.asp
This code looks interesting. It brings up the notion that there are
two basic ways a most recent files list is implemented, either where
each of the most recent files occupay a separate menu item in the
Files menu, or, in this case, a sub-menu from a menu item labelled
Recent Files. I'm guessing the submenu method would be easier to code.

It also uses the registry to store the list of most recent files. I
would like to avoid using the registry. I would also like to avoid an
external XML file as another responder suggested. I am thinking of
using the My.Settings to store the list of most recent files. That
would keep it all inside the application. Of course, that would cause
the same list of recent files shown for any user who runs the app on
the same computer (like in a Citrix environment), where the registry
would be a better choice. But with the app I am currently working on,
it will be used by a user who has sole access to their own self-
contained workstation, so I am still leaning to the My.Settings.
Aug 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by beliavsky | last post: by
5 posts views Thread by Konrad L. M. Rudolph | last post: by
6 posts views Thread by wukexin | last post: by
7 posts views Thread by William Payne | last post: by
2 posts views Thread by George Marsaglia | last post: by
2 posts views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
2 posts views Thread by GB | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.