using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace CD_Control
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("winmm.dll", EntryPoint = "mciSendStringA")]
public static extern void mciSendStringA(string lpstrCommand,
string lpstrReturnString, long uReturnLength, long hwndCallback);
//Why did i put this here?
string rt = "";
private void button1_Click(object sender, EventArgs e)
{
mciSendStringA("set CDAudio door open", rt, 127, 0); //Abre la bandeja del lector.
}
private void button2_Click(object sender, EventArgs e)
{
mciSendStringA("set CDAudio door closed", rt, 127, 0); //Cierra la bandeja del lector.
}
}
}