/// <summary> ///The mcisendstring function sends a command string to an MCI device. The device, the command is sent to was specified in the command string. /// </summary> /// <param name= "Lpszcommand" >Pointer to a null-terminated string, specifies an MCI command string. For a list, see Multimedia Command Strings.</param> /// <param name= "lpszreturnstring" >Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.</param> /// <param name= "Cchreturn" >Size, in characters, for the return buffer specified by the lpszreturnstring parameter.</param> /// <param name= "Hwndcallback" >Handle to a callback window if the "Notify" flag is specified in the command string.</param> /// <returns>Returns Zero if successful or an error otherwise. The Low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the High-order word of the return value is the driver identifier; Otherwise, the High-order word is zero. For a list of possible error values, see Mcierr Return values.</returns>[DllImport ("Winmm.dll", EntryPoint ="mcisendstring")] Public Static extern intmciSendString (stringLpszcommand,stringLpszreturnstring,UINTCchreturn, IntPtr hwndcallback); mciSendString ("Set cdaudio door open Wait","",0, This. Handle);//OpenmciSendString ("Set cdaudio door Closed wait","",0, This. Handle);//Close
Open/Close the optical drive