PDA

View Full Version : cd-rom tray open/close in turbo C/C++



R(-\/[-|_/\ti0n
03-23-2003, 03:59 PM
I need to write a program in Turbo C/C++ to make an MS-DOS executable that can open or close the CD-ROM drive tray. So far I can only detect for it... Also , I do not want to use any other APIs or compilers. My code so far....

#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main()
{
union REGS r;
clrscr();
r.x.ax=0x1500;
r.x.bx=0;
int86(0x2f,&r,&r);
if(!r.x.bx) printf("\n MSCDEX NOT INSTALLED OR NO CD-DRIVE");
else printf("\n MSCDEX INSTALLED OR CD-DRIVE FOUND");
getch();
}

Any help would be much appreciated. Thanks.

Vber
03-23-2003, 04:02 PM
Read this (http://cboard.cprogramming.com/showthread.php?s=&threadid=25765) . Your question is OS specific, ask in DOS board, you'll find answer faster.

Codeplug
03-23-2003, 04:16 PM
Then read this (http://www.he.net/~marcj/cdrom.html).

gg