Private Declare Function mciSendString Lib "winmm.dll" Alias _ "mciSendStringA" (ByVal lpstrCommand As String, ByVal _ lpstrReturnString As Long, ByVal uReturnLength As _ Long, ByVal hwndCallback As Long) As Long Dim vDrive As String Dim vAlias As String Private Sub Command1_Click() ' Открыть vDrive = "f:/" vAlias = "vv" & vDrive Call mciSendString("Open " & vDrive & ": Alias " & vAlias & " Type CDAudio", 0, 0, 0) Call mciSendString("Set " & vAlias & " Door Open", 0, 0, 0) End Sub Private Sub Command2_Click() ' Закрыть vDrive = "f:/" vAlias = "vv" & vDrive Call mciSendString("Open " & vDrive & ": Alias " & vAlias & " Type CDAudio", 0, 0, 0) Call mciSendString("Set " & vAlias & " Door Closed", 0, 0, 0) End Sub |
Код для открытия CD-ROM Для Поисковиков: Исходники на Бейсике; Программа на Бейсике; Код, открывающий CD-ROM на Visual basic; |