Click to See Complete Forum and Search --> : c++ winapi - recent documents


zaryk
February 1st, 2009, 02:06 AM
In many editors, there are options for showing recent documents opened in the program under menu header "File":


[File]

New
Open
Recent Documents
blah.txt
blah.txt
-SEPARATOR-



Can someone explain how this is done?

ovidiucucu
February 1st, 2009, 03:38 AM
By short, the scenario is the following:

Each time a document is saved into a file, the application adds the file name to a persistent list (i.e. it is saved in a configuration file or, most often, in the Windows registry).
When application starts again, it has to read that list and dynamically add corresponding items to the MRU menu.

Some libraries have already implemented this feature.
As for example MFC has built-in MRU support in its document-view framework, then the programmer has not to sweat to do that itself.

zaryk
February 5th, 2009, 01:24 PM
cool, thanks.