IF you have Visual Studio 2008< C++ then copy this to
Win32 and Compile and Run.!
Remember this is for fun
don't change the codes and make malware programs by this
and it may be very annoying cause every time Disk tray will eject and close then eject and close lolz
if u got any question regarding this then PM me.!
How to Eject and Close the CD Tray by Simple C++ Win32 Commands
remember this is ISO/IEC Implementation not C++/CLI so don't try on CLI and get screwed
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
#include <windows.h>
#pragma comment(lib, "winmm.lib")
using namespace std;
int main()
{
int _line,_final;
cout << "Pree any key to continue ,Hide or Show the Console 0/1.?" ;
cin >> _line;
if(_line == 0)
{
FreeConsole();
}
int num1= 10000;
for(int i=0;i<num1;i++)
{
cout << "Now Opening the DISK Tray...\a" << endl;
mciSendString("set CDAudio door open", NULL, 0, NULL);
cout << "Now Closing the DISK Tray in 500 milliseconds..." << endl;
cout << endl;
Sleep(500);
mciSendString("set CDAudio door closed", NULL, 0, NULL);
}
cout << "Elakiri.com 2010/06/13";
cin >> _final;
return 0;
}
Side Note
C++ Win32 is much lower level than other languages so it can be also used to write cracks.but it's upto you.!
No Reference.!
Win32 and Compile and Run.!
Remember this is for fun
don't change the codes and make malware programs by this
and it may be very annoying cause every time Disk tray will eject and close then eject and close lolz
if u got any question regarding this then PM me.!
How to Eject and Close the CD Tray by Simple C++ Win32 Commands
remember this is ISO/IEC Implementation not C++/CLI so don't try on CLI and get screwed

#include <iostream>
#include <windows.h>
#include <mmsystem.h>
#include <windows.h>
#pragma comment(lib, "winmm.lib")
using namespace std;
int main()
{
int _line,_final;
cout << "Pree any key to continue ,Hide or Show the Console 0/1.?" ;
cin >> _line;
if(_line == 0)
{
FreeConsole();
}
int num1= 10000;
for(int i=0;i<num1;i++)
{
cout << "Now Opening the DISK Tray...\a" << endl;
mciSendString("set CDAudio door open", NULL, 0, NULL);
cout << "Now Closing the DISK Tray in 500 milliseconds..." << endl;
cout << endl;
Sleep(500);
mciSendString("set CDAudio door closed", NULL, 0, NULL);
}
cout << "Elakiri.com 2010/06/13";
cin >> _final;
return 0;
}
Side Note
C++ Win32 is much lower level than other languages so it can be also used to write cracks.but it's upto you.!
No Reference.!
Last edited: