Results 1 to 3 of 3

Thread: Visual Basic 6 - Get Available Drives

  1. #1

    Thread Starter
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    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:
    1. Private Declare Function BringWindowToTop _
    2.     Lib "user32" ( _
    3.         ByVal hwnd As Long) _
    4.         As Long
    5.  
    6. Private Declare Function GetDriveType _
    7.     Lib "kernel32" _
    8.     Alias "GetDriveTypeA" ( _
    9.         ByVal nDrive As String) _
    10.         As Long
    11.  
    12. Private Declare Function GetLogicalDriveStrings _
    13.     Lib "kernel32" _
    14.     Alias "GetLogicalDriveStringsA" ( _
    15.         ByVal nBufferLength As Long, _
    16.         ByVal lpBuffer As String) _
    17.         As Long
    18.        
    19. Private Declare Function GetDiskFreeSpace _
    20.     Lib "kernel32" _
    21.     Alias "GetDiskFreeSpaceA" ( _
    22.         ByVal lpRootPathName As String, _
    23.         lpSectorsPerCluster As Long, _
    24.         lpBytesPerSector As Long, _
    25.         lpNumberOfFreeClusters As Long, _
    26.         lpTotalNumberOfClusters As Long) _
    27.         As Long
    28.  
    29. Private Declare Function GetVolumeInformation _
    30.     Lib "kernel32" _
    31.     Alias "GetVolumeInformationA" ( _
    32.         ByVal lpRootPathName As String, _
    33.         ByVal lpVolumeNameBuffer As String, _
    34.         ByVal nVolumeNameSize As Long, _
    35.         lpVolumeSerialNumber As Long, _
    36.         lpMaximumComponentLength As Long, _
    37.         lpFileSystemFlags As Long, _
    38.         ByVal lpFileSystemNameBuffer As String, _
    39.         ByVal nFileSystemNameSize As Long) _
    40.         As Long

    if you have any improvements or suggestions then let me know? I would love to know what you guys think .

    Regards,

    Jenova
    Attached Files Attached Files

  2. #2

    Thread Starter
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    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

  3. #3
    New Member
    Join Date
    Feb 2007
    Posts
    11

    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width