January 1, 2005

WinTask - CDOpenClose

'
' CDOpenClose
'
' Open/Close the CD tray
'
' Author: Joe Strazzere
'

'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
'Procedure
' "set CDAudio door open"
' "set CDAudio door closed"
'  audio all off
'  audio all on
'  audio left off
'  audio left on
'  audio right off
'  audio right on
'  door closed
'  door open
'  time format milliseconds
'  time format msf
'  time format tmsf

ret$="1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567890+1234567"
ret=External("winmm.dll","mciSendStringA","set CDAudio door open",ret$,127,0)
pause 3 secs
ret=External("winmm.dll","mciSendStringA","set CDAudio door closed",ret$,127,0)