I've received mixed research results on this, some long and some simple. I've found a few snippets (that I try to use an example) but they don't work :\
Seems alright at first glance...
I haven't tried it yet but the comments below the article looked promising!
I was thinking of mciSendString() as well, I found a similiar snippet to that one and it didnt work, I'll try this one and we'll see. As long as it is a working snippet I can learn from it.
Okay well mciSendString() worked. This is what I have. I had to include libwinmm.a with Dev-C++ in order for it to work (As the snippet posted by Dr3DsY directed) This what I've got:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
usingnamespace std;
int main()
{
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;
}
so this one I am guessing is compatible with windows XP, if anyone knows of newer OS commands for the CD tray please elaborate or a more "universal" way to do it.