Hi all,
Here is a simple used to Open and Close CD TRAY.
Comment it PLEASE!
[CODE=vb]'add this lines of code in the declaration section of a standard module.
'---------------
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA " _
(ByVal lpszCommand As String, ByVal lpszReturnStrin g As String, _
ByVal cchReturnLength As Long, ByVal hwndCallback As Long) As Long
'--------------
'Now in the module also declare this
'-----------------------------------
Sub opencd()
Call mciSendString(" set CDAudio door open", 0, 0, 0)
End Sub
Sub closecd()
Call mciSendString(" set CDAudio door closed", 0, 0, 0)
End Sub
'-----------------------------------
'Now add two command buttons to the form ( its obvious what i have taken below)
'-----------------------------------
Private Sub Command1_Click( )
Call Module1.opencd
End Sub
Private Sub Command2_Click( )
Call Module1.closecd
End Sub
'----------------------------------[/CODE]
Regards
>> ALI <<
Here is a simple used to Open and Close CD TRAY.
Comment it PLEASE!
[CODE=vb]'add this lines of code in the declaration section of a standard module.
'---------------
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA " _
(ByVal lpszCommand As String, ByVal lpszReturnStrin g As String, _
ByVal cchReturnLength As Long, ByVal hwndCallback As Long) As Long
'--------------
'Now in the module also declare this
'-----------------------------------
Sub opencd()
Call mciSendString(" set CDAudio door open", 0, 0, 0)
End Sub
Sub closecd()
Call mciSendString(" set CDAudio door closed", 0, 0, 0)
End Sub
'-----------------------------------
'Now add two command buttons to the form ( its obvious what i have taken below)
'-----------------------------------
Private Sub Command1_Click( )
Call Module1.opencd
End Sub
Private Sub Command2_Click( )
Call Module1.closecd
End Sub
'----------------------------------[/CODE]
Regards
>> ALI <<
Comment