By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,646 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,646 IT Pros & Developers. It's quick & easy.

Implementing a "Most Recent Files" list

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.