如何控制光驱的进出?

解决方案 »

  1.   

    在Form中添加两个按钮分别为Command1、Command2
    >-----------------------------
    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 LongSub OpenCDDoor()
      mciSendString "Set CDAudio Door Open Wait", 0&, 0&, 0&
    End SubSub CloseCDDoor()
      mciSendString "Set CDAudio Door Closed Wait", 0&, 0&, 0&
    End SubPrivate Sub Command1_Click()
    Call OpenCDDoor
    End SubPrivate Sub Command2_Click()
    Call CloseCDDoor
    End Sub
    ----------------------------<