В форму-то? Имхо не удастся.KDima писал(а):Попробуй насильно вставить иконку при помощи ресурс едита....
Option Explicit
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
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 Type HDDInfo
sVolumeLabel As String 'label of this drive
sFileSystem As String 'file system
lSerialNumber As Long 'hdd serial number
lFileSystemFlags As Long 'filesystemflags
dTotalHDDSpace As Double 'totlal hdd space
End Type
Private hdd As HDDInfo
Public Sub InitHDDInfo(sDriveLetter As String)
Dim lSecPerClus As Long, lBytPerSec As Long, lFreeClus As Long, lTotalClus As Long
Dim lMaxCompLen As Long
hdd.sVolumeLabel = String$(260, vbNullChar)
hdd.sFileSystem = String$(6, vbNullChar)
'get hdd info
If GetVolumeInformation(sDriveLetter, hdd.sVolumeLabel, Len(hdd.sVolumeLabel), hdd.lSerialNumber, lMaxCompLen, hdd.lFileSystemFlags, hdd.sFileSystem, Len(hdd.sFileSystem)) Then
hdd.sVolumeLabel = Replace$(hdd.sVolumeLabel, vbNullChar, vbNullString)
hdd.sFileSystem = Replace$(hdd.sFileSystem, vbNullChar, vbNullString)
End If
'get total hdd space
hdd.dTotalHDDSpace = 0
If GetDiskFreeSpace(sDriveLetter, lSecPerClus, lBytPerSec, lFreeClus, lTotalClus) Then
hdd.dTotalHDDSpace = lSecPerClus * lBytPerSec * lTotalClus
End If
End Sub
Public Function TestHddFileSystem() As String
TestHddFileSystem = hdd.sFileSystem
End Function
Public Function TestHddSerialNumber() As String
TestHddSerialNumber = hdd.lSerialNumber
End Function
Public Function TestHddFileSystemFlags() As String
TestHddFileSystemFlags = hdd.lFileSystemFlags
End Function
Public Function TestHddTotalSpace() As String
TestHddTotalSpace = hdd.dTotalHDDSpace
End Function
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 9