1 Attachment(s)
Visual Basic 6 - Get Available Drives
This project demostrates how to retrieve all available drives using the following API's and display all of the Information in a Listview.
API's Used
VB Code:
Private Declare Function BringWindowToTop _
Lib "user32" ( _
ByVal hwnd As Long) _
As Long
Private Declare Function GetDriveType _
Lib "kernel32" _
Alias "GetDriveTypeA" ( _
ByVal nDrive As String) _
As Long
Private Declare Function GetLogicalDriveStrings _
Lib "kernel32" _
Alias "GetLogicalDriveStringsA" ( _
ByVal nBufferLength As Long, _
ByVal lpBuffer As String) _
As Long
Private Declare Function GetDiskFreeSpace _
Lib "kernel32" _
Alias "GetDiskFreeSpaceA" ( _
ByVal lpRootPathName As String, _
lpSectorsPerCluster As Long, _
lpBytesPerSector As Long, _
lpNumberOfFreeClusters As Long, _
lpTotalNumberOfClusters As Long) _
As Long
Private Declare Function GetVolumeInformation _
Lib "kernel32" _
Alias "GetVolumeInformationA" ( _
ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) _
As Long
if you have any improvements or suggestions then let me know? I would love to know what you guys think :D.
Regards,
Jenova
Re: Visual Basic 6 - Get Available Drives
Does any body have any suggestions that i can use to make this project better or any feedback on the code?
Regards,
Jenova
Re: Visual Basic 6 - Get Available Drives
Hi,
What if you restrict the read/write access to the drives, by providing a password.
Regards,
Dinesh
[email protected]