Even if you need to target both Windows 7 and older versions, you can use the Code Pack, but you will need to do some checking to make sure the libraries exist. Consider these three lines from ThumbnailToolbarDemoWinforms (the project in the "Shell" folder in the Code Pack samples):
ShellContainer pics = (ShellContainer)KnownFolders.Pictures; if (ShellLibrary.IsPlatformSupported) pics = (ShellContainer)KnownFolders.PicturesLibrary;
This uses the My Pictures folder as a backup on older operating systems. KnownFolders is one of the benefits of the Code Pack that offers you as a developer. You can use Environment.SpecialFolder.MyPictures if you are not going to use the Code Pack at all, but why reinvent the wheel?
source share