Hello...
This is an API on closing and opening cdrom drive.
I tried searching for this online and found many for vb6.But,there was none for vb.net.but,finally,I figured it out.I got little bit of help from my friend Oliver too...
Hope this helps someoneVB Code:
'This is an API called mcisendstring,a readymade function from the winmm.dll available in windows. 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 Private Sub opencd() mciSendString("set CDAudio door open", 0, 0, 0) 'here,were sending the command for opening.Its case sensitive and should be EXACT..and same way for closing too. :) End Sub Private Sub closecd() mciSendString("set CDAudio door closed", 0, 0, 0) End Sub
Edit...Thanks to jo0ls for the cdrom lock function too ...Here it is...






Reply With Quote