CD tray opener I made for mIRC DeluXe 1.5.82+. In mIRC DeluXe you press F5 (or select it from the popup menus) and it launched the program and opens the CD tray, you place in or remove the CD and press any key, the CD tray closes and program exits. Windows then takes the necessary action i.e. auto play, or choose action etc. You can use it in your mIRCs or programs!
Make sure you add the libwinmm.a to the project (in Dev-C++) or it wont work!
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
using namespace std;
int main()
{
cout << "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" <<endl;
cout << "º CD Tray Opener 1.0 º" <<endl;
cout << "º By Neo Nemesis º" <<endl;
cout << "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" <<endl;
mciSendString("open CDAudio", NULL, 0, NULL);
cout << "CD Tray is opening please wait..." << endl;
mciSendString("set CDAudio door open", NULL, 0, NULL);
cout << "CD Tray is open please place in or remove CD and ";
system("pause");
mciSendString("set CDAudio door closed", NULL, 0, NULL);
mciSendString("close CDAudio", NULL, 0, NULL);
return 0;
}