using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int ret = mciSendString("CD Sürücüsünü Aç", null, 0, IntPtr.Zero);
}
private void button2_Click(object sender, EventArgs e)
{
int ret = mciSendString("CD Sürücüsünü Kapat", null, 0, IntPtr.Zero);
}
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)]
protected static extern int mciSendString(string lpstrCommand,
StringBuilder lpstrReturnString,
int uReturnLength,
IntPtr hwndCallback);
}
}