Tuesday, September 30, 2008

eComics, MRU's and My Recent Documents

Well, my testbed for WindowsForms development has received another release. Version 0.0.1.003 of eComic is now up, and waiting for downloading over at Codeplex (http://www.codeplex.com/ecomic/).

Quite a number of changes for this release, most of them are fixing behaviors, getting things closer to creating/using a reading list, but there were two that I really wanted to point out. These two are new classes that I added into my source code; one is a MRU Files listing, and the other adds accessed files to the "My Recent Documents" list on the user's START menu.

The latter of the two is merely a simple WIN32 Interop wrapper for the SHELL DLL. Nothing obscenely fancy, but it works.

The former (see the source code here) is a bit more involved. It's a class, which takes in 3 things: a ToolStripMenuItem object, the application's name and the number of files that can be on the MRU list. It then generates additional ToolStripMenuItems to go into the intial ToolStripMenuItem's DropDownItems attributes.

The class itself raises an event when one of those child Menu Items are chosen, passing the selected file path & name to the parent class. I just shoved this information into the registry because that was easy for me, but it wouldn't be that hard to retrofit it to store the data into a database or even a flat file.

No comments:

Blog Widget by LinkWithin