How do I eject the CDROM drive from my program?
Printable View
How do I eject the CDROM drive from my program?
You can download the source code at
http://www.codeguru.com/multimedia/cd_audio.shtml
Hey, thanks, but I don't need any of that CD Audio system stuff, just the part that ejects / closes the CDROM drive. I can't use only that part from the sample without having the rest, and it'll just weigh my program down unnecessarily. Can you tell me the bare minimum I need to do open/close the door? I isolated the function that did it, but what about the initialization and everything on which the function indirectly depends?
Have a look at DeviceIoControl. The way you use it depends on if you are running 95/98 or NT
Hope this helps,
Gary Kirkham
#include <windows.h>
void main(void)
{
char returnstring[1024];
MCIERROR result;
result = mciSendString("set CDAudio door closed",
returnstring, 127, 0);
}
Hey, thanks a lot dude!
Just one more thing... if I want to detect the current state (open/closed) and then give the appropriate command(close/open), what should I do?