Cd-Rom Opening And Closing:
The following program shows you how to open and close the cd-rom.
Code
Code
using System.Runtime.InteropServices;
[DllImport("winmm.dll",EntryPoint="mciSendStringA",
ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
public static extern long mciSendString(string lpCommandString, string lpReturnString, long uReturnLength, long hwndCallback);
public void btnOpen_Click(System.Object sender, System.EventArgs e)
{
mciSendString("set CDAudio door open", "", 0, 0);
}
public void btnClose_Click(System.Object sender, System.EventArgs e)
{
mciSendString("set CDAudio door closed", "", 0, 0);
}
0 comments:
Post a Comment