| Opening and Closing the CD-ROM Tray This can be done by using the mciSendString API function, which I have for ease of use renamed to MCI, but to open or close the CD-ROM door use the following function: Private Declare Function MCI Lib "winmm.dll" Alias _"mciSendStringA" (ByVal lpstrCommand As String, _ ByVal lpstrReturnString As Any, ByVal uReturnLength _ As Long, ByVal hwndCallback As Long) As Long Public Enum eState lOpen = 1 lClosed = 2 End Enum Public Function CDDoor(lState As eState) As Long Dim sState As String If lState = lClosed Then sState = "Closed" Else sState = "Open" CDDoor = MCI("Set CDAudio Door " & sState, "", 0, 0) End Function Call by using <Success = 0> = CDDoor(<Option>)If 0 is returned then the drive is now shut or open depending on what parameter you set. |
___________________________________________ Send Bugs, comments to the webmaster at webmaster@mwe.8m.com © 1999 MW Software, all rights reserved |