Get all drive names
BlitzMax Forums/BlitzMax Beginners Area/Get all drive names
| ||
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. |
| ||
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.. |
| ||
This code shows how to find the fonts folder on WindowsImport "-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 |
| ||
http://www.blitzbasic.com/Community/posts.php?topic=66311 |