If i have 2 cd drives one is a burner, and one is a pos! how can i check to see which one has a cd in it, or what cd, or eject them and stuff like that?
Printable View
If i have 2 cd drives one is a burner, and one is a pos! how can i check to see which one has a cd in it, or what cd, or eject them and stuff like that?
To open and close the CD drive
Code:Private 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
Private Sub cmdOpen_Click()
'Open the CD Drive
mciSendString "set CDAudio door open", 0, 127, 0
End Sub
Private Sub cmdClose_Click()
'Close the CD Drive
mciSendString "set CDAudio door closed", 0, 127, 0
End Sub
Take a look at the platform SDK: Base Services->Hardware->Device Input and Output->Device Input and Output Reference->Device Input and Output Control Codes->IOCTL_STORAGE_CHECK_VERIFY.
This is untested, but is a possibility to see if it has a CD loaded or not.