Get all drive names

BlitzMax Forums/BlitzMax Beginners Area/Get all drive names

SculptureOfSoul(Posted 2007) [#1]
What's the easiest way to do this? More specifically, I need to get the users Windows/Fonts directory, but don't want to assume that that directory is on the same drive that the application is installed on, so want to check all the drives.


SculptureOfSoul(Posted 2007) [#2]
Right now the only way I can see to do it is to call ReadDir() with all the letters of the alphabet and check the return value to see if the drive exists..


Azathoth(Posted 2007) [#3]
This code shows how to find the fonts folder on Windows
Import "-lshell32"

Const CSIDL_FONTS=$14

Extern "Win32"
	Function SHGetFolderPathA:Int(hwndOwner:Byte Ptr, nFolder:Int, hToken:Byte Ptr, dwFlags:Int, pszPath:Byte Ptr)
EndExtern

Local cString:Byte[255]

If SHGetFolderPathA(Null, CSIDL_FONTS, Null, $0000, cString)=0
	Print String.FromCString(cString)
EndIf



Beaker(Posted 2007) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=66311