Finding My Documents

Blitz3D Forums/Blitz3D Programming/Finding My Documents

Makepool(Posted 2007) [#1]
I’ve searched around a bit and there does seem to be some code floating around to find out what the current location of ‘my documents’ is on XP and Vista but I can’t find a solution to this in Blitz3D. There surely has to be a way if it’s true that Vista won’t let programs write data outside of My Documents in some modes, as others on these forums are claiming, otherwise Blitz3D would be useless for anyone running Vista.


Kev(Posted 2007) [#2]
under xp if you access the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

see key 'Personal' has the location to 'My Documents'

not sure about vista though.

kev


Makepool(Posted 2007) [#3]
I don’t really know how to access registry keys, and I’m not sure I really want to start messing about with registry. Even if I did learn that wouldn’t really help me if it’s an XP only solution. Perhaps if enough people lodge their vote we could get Mark to extend the GetEnv$() command.


b32(Posted 2007) [#4]
Maybe you could use the SHGetFolderPathA function from shell32.decls ? Here is the msdn description:
http://msdn2.microsoft.com/en-us/library/ms647764.aspx



Makepool(Posted 2007) [#5]
Thank you so much, that works a treat. Perhaps you should consider adding it to the code archives, I'm sure many people will find that code very useful indeed. Once again, thank you very much!


b32(Posted 2007) [#6]
Okay, will do that. I'm glad it works.