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 OpenCloseDrive
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        //Why did i put this here?
        String rt = String.Empty;

        /// <summary>
        /// Importing this god forbiden dll
        /// </summary>
        [DllImport("winmm.dll", EntryPoint = "mciSendStringA")]
        public static extern void mciSendStringA(String lpstrCommand, String lpstrReturnString, long uReturnLength, long hwndCallback);

        private void button1_Click(object sender, EventArgs e)
        {
            mciSendStringA("set CDAudio door open", rt, 127, 0);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            mciSendStringA("set CDAudio door closed", rt, 127, 0);
        }


    }
}
