Board index » delphi » How do I get the CD tray to close after opening it with an MCI call

How do I get the CD tray to close after opening it with an MCI call

I have been trying to figure this out for a little while now and have not
come up with any clues.  I have not been able to find an MCI call for this
( or at least one that I recognize ).  Any suggestions/prods in the right
direction/etc. would be greatly appreciated!

-----------
Michael P. Schneider
email: slann...@pacbell.net

 

Re:How do I get the CD tray to close after opening it with an MCI call


Michael P. Schneider <slann...@pacbell.net> wrote in article
<01bbc174$71cdcb20$b18a68cf@michael>...

Quote
> I have not been able to find an MCI call for this
> ( or at least one that I recognize ).

As I recall, it's almost *exactly* the same as getting the tray to open.
Try the command MCI_CLOSE in the online help.

Chris.

Re:How do I get the CD tray to close after opening it with an MCI call


"Michael P. Schneider" <slann...@pacbell.net> wrote:

Quote
> I have been trying to figure this out for a little while now and have not
> come up with any clues.  I have not been able to find an MCI call for this
> ( or at least one that I recognize ).  Any suggestions/prods in the right
> direction/etc. would be greatly appreciated!

Try  
        mciSendString('set cdaudio door closed', nil, 0, 0 );

Re:How do I get the CD tray to close after opening it with an MCI call


How about if you issued a play command?  I know with both my CD-ROM, and my
laserdisc player, that if I hit the play button while the tray is open, it
will close.  Of course, if there is no disc in the drive, the play will
fail, but that should be OK.  Of course, if there IS a disc in the drive
and you didn't really want to play it, well, that could be trouble.  Though
I suppose immediately following the play command with a stop would probably
work.  Now, I haven't done any MCI work at all, so you'll have to let me
know if this works for you!

--
David S. Becker
ADP Dealer Services (Plaza R&D)
d...@plaza.ds.adp.com
(503)402-3236

Michael P. Schneider <slann...@pacbell.net> wrote in article
<01bbc174$71cdcb20$b18a68cf@michael>...

Quote
> I have been trying to figure this out for a little while now and have not
> come up with any clues.  I have not been able to find an MCI call for
this
> ( or at least one that I recognize ).  Any suggestions/prods in the right
> direction/etc. would be greatly appreciated!

> -----------
> Michael P. Schneider
> email: slann...@pacbell.net

Re:How do I get the CD tray to close after opening it with an MCI call


Michael P. Schneider <slann...@pacbell.net> wrote in article
<01bbc174$71cdcb20$b18a68cf@michael>...

Quote
> I have been trying to figure this out for a little while now and have not
> come up with any clues.  I have not been able to find an MCI call for
this
> ( or at least one that I recognize ).  Any suggestions/prods in the right
> direction/etc. would be greatly appreciated!

set cdaudio door closed (MCI_SET, MCI_SET_DOOR_CLOSED)

  - S

--
The opinions expressed in this message are my own personal views
and do not reflect the official views of Microsoft Corporation.

Re:How do I get the CD tray to close after opening it with an MCI call


Quote
Michael P. Schneider wrote:

> I have been trying to figure this out for a little while now and have not
> come up with any clues.  I have not been able to find an MCI call for this
> ( or at least one that I recognize ).  Any suggestions/prods in the right
> direction/etc. would be greatly appreciated!

> -----------
> Michael P. Schneider
> email: slann...@pacbell.net

To my best knowledge, there is no "close door" command. However, some
CD-ROMs close door when EJECT called with open doors.
If your CD-ROM is SCSI, try following calls (see for details in WIN32
SDK):
IOCTL_DISK_LOAD_MEDIA
IOCTL_DISK_EJECT_MEDIA

However, there are some CD-ROMS which cannot do that just because there
is no hardware to do that. On some of them EJECT is simply signal to
release spring, which opens door. There is no way how to close it the
other way than to use your hand :-)

--

 -------   Vlasti BROUCEK, MSc GradDipSci(IT)
| *   * |  Network Administrator/Programmer
|   !   |  
| \___/ |  Psychology, Department of
 \_____/   University of Tasmania
           GPO Box 252-30
           Hobart  TAS  7001
           Australia        

phone : +61 (3) 6226 2346
fax   : +61 (3) 6226 2883

AARNet: Vlasti.Brou...@psychol.utas.edu.au
URL:    http://brouk.psychol.utas.edu.au/vlasti.html

Re:How do I get the CD tray to close after opening it with an MCI call


"Michael P. Schneider" <slann...@pacbell.net> wrote:

Quote
>I have been trying to figure this out for a little while now and have not
>come up with any clues.  I have not been able to find an MCI call for this
>( or at least one that I recognize ).  Any suggestions/prods in the right
>direction/etc. would be greatly appreciated!
>-----------
>Michael P. Schneider
>email: slann...@pacbell.net

The command is:  "Set cdaudio door closed wait"

--
Wolfgang John    - Shareware -
wj...@fix.net    http://www.fix.net/~wjohn
 - Phone Dialer and Logger - CD Player and Library - Win3.1 / Win95

Re:How do I get the CD tray to close after opening it with an MCI call


Wolfgang John <wj...@fix.net> wrote in article
<54qq4p$...@twizzler.callamer.com>...

Quote

> The command is:  "Set cdaudio door closed wait"

Or you could use:

{ flags for dwFlags parameter of MCI_SET command message }
const
  MCI_SET_DOOR_OPEN               = $00000100;
  MCI_SET_DOOR_CLOSED             = $00000200;

This is an extract from the MMSystem file. Try browsing the MM.hlp.

Chris.

Other Threads