Results 1 to 12 of 12

Thread: Closing/opening cdrom drive

Threaded View

  1. #1

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Lightbulb Closing/opening cdrom drive

    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...
    VB Code:
    1. 'This is an API called mcisendstring,a readymade function from the winmm.dll available in windows.
    2.  Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
    3. (ByVal lpszCommand As String, ByVal lpszReturnString As String, _
    4. ByVal cchReturnLength As Long, ByVal hwndCallback As Long) As Long
    5.  
    6.     Private Sub opencd()
    7.         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. :)
    8.     End Sub
    9.  
    10.     Private Sub closecd()
    11.         mciSendString("set CDAudio door closed", 0, 0, 0)
    12.     End Sub
    Hope this helps someone

    Edit...Thanks to jo0ls for the cdrom lock function too ...Here it is...
    Attached Files Attached Files
    Last edited by uniquegodwin; Dec 10th, 2005 at 06:17 AM.
    Godwin

    Help someone else with what someone helped you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width