CyberCarsten
Jan 13th, 2000, 02:37 AM
I have made this program to calculate total amount of free space
on a harddrive...BUT!!!
It only goes to 2,147,155,968 bytes!!
I know there is an extended version of the GetDiskFreeSpace...could
anyone help??
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 Sub Drive1_Change()
Dim x As Long
Dim SperC As Long
Dim BPerS As Long
Dim NoFC As Long
Dim TNoC As Long
Dim BytesFree As Long
Dim Root As String
Root = Left(Drive1.Drive, 2) & "\"
x& = GetDiskFreeSpace(Root, SperC&, BPerS, NoFC&, TNoC&)
'Fill Labels
Label1.Caption = Format(SperC& * BPerS * NoFC&, "0,000") & " bytes"
Label2.Caption = Format(SperC& * BPerS * NoFC& / 1024000, "0.00") & " MB"
End Sub
on a harddrive...BUT!!!
It only goes to 2,147,155,968 bytes!!
I know there is an extended version of the GetDiskFreeSpace...could
anyone help??
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 Sub Drive1_Change()
Dim x As Long
Dim SperC As Long
Dim BPerS As Long
Dim NoFC As Long
Dim TNoC As Long
Dim BytesFree As Long
Dim Root As String
Root = Left(Drive1.Drive, 2) & "\"
x& = GetDiskFreeSpace(Root, SperC&, BPerS, NoFC&, TNoC&)
'Fill Labels
Label1.Caption = Format(SperC& * BPerS * NoFC&, "0,000") & " bytes"
Label2.Caption = Format(SperC& * BPerS * NoFC& / 1024000, "0.00") & " MB"
End Sub