tags:

views:

60

answers:

2

How can I get target path for "My Pictures" folder in Window Seven? In Seven we've two folders: "Pictures" and "My Pictures" (second links on a first). So in my app I display both folder, and want understand that "My Pictures" folder is only shot-cut. What attribute should I use or other way?

+2  A: 

The Pictures in Windows 7 is part of Libraries. Windows API code pack has some useful libraries for managing Windows 7 Libraries.

and My pictures is part of Special folder which you can get using Environment.SpecialFolder. If you are targeting only Windows 7 then I would recommend you to check out the Windows API code pack which has lots of new features which you can use in your application. Has extensive support for libraries and select folder dialog etc

Shoban
Unfortunately, I'm targeting not only on Windows 7. And now I have "My Pictures" folder as usual folder. (my control is like win explorer). So when I try to go into this folder I don't switch on correct "Pictures" folder. I mean can I understand that this folder is shot-cut on other fodler?
no pictures in windows 7 is not a shortcut to My Pictures. You can consider it like an Album in many albums inside it
Shoban
A: 

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 libraries exist. Consider these three lines from the ThumbnailToolbarDemoWinforms (a project in the Shell folder of the Code Pack samples):

    ShellContainer pics = (ShellContainer)KnownFolders.Pictures;

    if (ShellLibrary.IsPlatformSupported)
        pics = (ShellContainer)KnownFolders.PicturesLibrary;

This uses the "My Pictures" folder as a fallback on older operating systems. KnownFolders is one of the goodies Code Pack offers you as a developer. You could use Environment.SpecialFolder.MyPictures if you aren't going to use Code Pack at all, but why reinvent the wheel?

Kate Gregory