Cod:
- Cod:
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "Deschide")
{
int ret = mciSendString( "set cdaudio door open",
null, 0, IntPtr.Zero);
button1.Text = "Inchide";
}
else
{
int ret = mciSendString( "set cdaudio door closed",
null, 0, IntPtr.Zero);
button1.Text = "Deschide";
}
}
[DllImport( "winmm.dll",
EntryPoint = "mciSendStringA",
CharSet = CharSet.Ansi)]
protected static extern int mciSendString(
string lpstrCommand,
StringBuilder lpstrReturnString,
int uReturnLength,
IntPtr hwndCallback);