 | Banned | | Join Date: Aug 2007 Location: Lahore Pakistan
Posts: 929
# 1
Feb 25 '08
| |
Hi all,
Here is a simple used to Open and Close CD TRAY.
Comment it PLEASE! - '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 lpszReturnString 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
-
'----------------------------------
Regards
>> ALI <<
Last edited by debasisdas; Feb 27 '08 at 09:15 AM.
Reason: added code=vb tags
|