VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Open And Close CD Drives

by Tom Putland (3 Submissions)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Sat 11th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Open And Close CD Drives

API Declarations



Add This In A Module:

Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Rate Open And Close CD Drives



Dim lngReturn As Long
Dim strReturn As Long

'To open the CD door, use this code:
lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
End Sub

Private Sub Command2_Click()
Dim lngReturn As Long
Dim strReturn As Long

'To close the CD door, use this code:
lngReturn = mciSendString("set CDAudio door closed", strReturn, 127, 0)
End Sub


Download this snippet    Add to My Saved Code

Open And Close CD Drives Comments

No comments have been posted about Open And Close CD Drives. Why not be the first to post a comment about Open And Close CD Drives.

Post your comment

Subject:
Message:
0/1000 characters