CD Drive Access

Started by
4 comments, last by The Mad Man 23 years, 7 months ago
I''m wondering how you access the CD-ROM drive and then use it. I''m specifically referring to opening and closing the disk door. Could anyone help me here?
Advertisement
Which OS are you using?
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Win 9X/2000
Okay, there are Win32 API functions that being with "mci" which can be used for that. Look them up in MSDN. This is the function you can use to open the the CD door:

MCIERROR mciSendString(
LPCTSTR lpszCommand,
LPTSTR lpszReturnString,
UINT cchReturn,
HANDLE hwndCallback
);

The lpszCommand string contains a string with the command. I think you can pass it something like "set audio all on" to open the CD door. You can find more info on MSDN

Edited by - Muzzafarath on August 31, 2000 3:28:42 AM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Ummm.... Mr. avatar there is playing with you or at least I''ve never seen that mci string and it logically doesn''t make sense.
I made a program that opens and closes the CD door and it uses these two (Tried, tested and true!)

"set CDAudio door open" - to open
"set CDAudio door closed" - to close

This are pretty obvious! I have no idea what "set audio all on" does but it looks like it''d make sure all the chanells are un-muted or something... Any how look at MSDN!

See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
I took a look at MSDN, it said that "set audio all off" should close the CD door... Nevermind, I''ve never tested "my" way, and since you say your way works...
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall

This topic is closed to new replies.

Advertisement