@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The SHAddToRecentDocs API !!!!C# Signature: [DllImport("shell32.dll", CharSet = CharSet.Ansi)] public static extern void SHAddToRecentDocs(ShellAddToRecentDocsFlags flag, string path); [DllImport("shell32.dll")] public static extern void SHAddToRecentDocs(ShellAddToRecentDocsFlags flag, IntPtr pidl); !!!!User-Defined Types: public enum ShellAddToRecentDocsFlags { Pidl = 0x001, Path = 0x002, } !!!!Notes: None. !!!!Tips & Tricks: Helper: public static void AddToRecentDocs(string path) { SHAddToRecentDocs(ShellAddToRecentDocsFlags.Path, path); } !!!!Sample Code: class ShellApi { public enum ShellAddToRecentDocsFlags { Pidl = 0x001, Path = 0x002, } [DllImport("shell32.dll", CharSet = CharSet.Ansi)] public static extern void SHAddToRecentDocs(ShellAddToRecentDocsFlags flag, string path); [DllImport("shell32.dll")] public static extern void SHAddToRecentDocs(ShellAddToRecentDocsFlags flag, IntPtr pidl); public static void AddToRecentDocs(string path) { SHAddToRecentDocs(ShellAddToRecentDocsFlags.Path, path); } } class MainForm : Form { ... void OpenDocument(string newFilename) { ... // Put the file into the Start->Documents list ShellApi.AddToRecentDocs(newFilename); } void SaveDocument(string newFilename) { ... // Put the file into the Start->Documents list ShellApi.AddToRecentDocs(newFilename); } ... } !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Credits: Chris Sells (csells@sellsbrothers.com). Documentation: SHAddToRecentDocs@msdn on MSDN
Edit shell32.SHAddToRe...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.