Ever wanted to write a killer pictures app for WM? Ever wanted to do something cool like anotate pictures? Chances are, you’ll want to include a good old conventional folder-browser dialog to ensure your users can locate their folders manually.
SHGetSpecialFolder, while a great API in theory and documentation, is something you should treat with great skepticism – especially if you’re going to write to the folder returned by this function without confirming it with your users first.
SHGetSpecialFolder returns a hardcoded path to \My Documents\My Pictures. Don’t see anything wrong with that? Wait till you add a storage card to your phone (which you’re bound to do, unless you have one of the expensive models that come with a few gigs of inbuilt storage (and yet this will fail on that kind of storage too – HTC Diamond is a known example)). If your camera is storing pictures on a storage card, then it turns out, there is either no spec for where this path will be stored in a uniform manner, or the OEMs didn’t stick to it. Either way, there’s very little we can do about it. It’s out there, and that’s how it is, and you need to live with it.
There isn’t really a reliable way to get the folder to which your camera is saving pictures by default, and while a best-effort attempt at locating it can be done by some registry hacks and SHGetSpecialFolder, it would be a good precaution to confirm the path with your users first, and give them the option of locating the path if you get it wrong.