SHGetSpecialFolderLocation()
or the newer SHGetFolderPath()
was the correct thing to do, instead of accessing the registry. A few days ago I found this blog post by Raymond Chen that explain exactly why you shouldn't.
Although MS tried - too far IMHO - to allow bad written application to run, Vista is starting to change it. Time to check current application and proper implement the new ones. We mustn't be lazy, must read the documentation, and don't be afraid to change the way we were used to code.