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.