Всем привет!
Подскажите, plz, как распознать, какой диск вставлен в сидюк? Интересует, является ли диск CDDA, является ли смешанным (Audio+данные). Остальные диски пусть будут "другое".
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 Sub Form_Load()
Dim Serial As Long, VName As String, FSName As String
Dim CDRomDrive As String
CDRomDrive = InputBox("Drive to test:")
If CDRomDrive = "" Then Exit Sub
CDRomDrive = Left(CDRomDrive, 1) & ":\"
'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
'Get the volume information
GetVolumeInformation CDRomDrive, VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
MsgBox "The Volume name of " & CDRomDrive & " is '" + VName + "', the File system name is '" + FSName + "' and the serial number is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 22