Article View: comp.lang.pascal.delphi.misc
Article #381Re: How tto eject CD-ROM ?
From: Dave Parsons
Date: Mon, 24 May 1999 00:00
Date: Mon, 24 May 1999 00:00
54 lines
2485 bytes
2485 bytes
Eric,
Take a look:
procedure CDOpenClose;
var
MCIO: TMCI_Open_Parms;
MCIS: TMCI_Status_Parms;
begin
MCIO.lpstrDeviceType := PChar(MCI_DEVTYPE_CD_AUDIO);
if mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE or MCI_OPEN_TYPE_ID or
MCI_OPEN_SHAREABLE, LongInt(@MCIO)) = 0 then
begin
MCIS.dwItem := MCI_STATUS_READY;
mciSendCommand(MCIO.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM or MCI_WAIT,
LongInt(@MCIS));
if MCIS.dwReturn <> 0 then mciSendCommand(MCIO.wDeviceID, MCI_SET,
MCI_SET_DOOR_OPEN, 0)
else
mciSendCommand(MCIO.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0);
mciSendCommand(MCIO.wDeviceID, MCI_CLOSE, MCI_WAIT, 0);
end;
end;
--
Good Luck!!
-Dave
Inprise Certified Delphi 4 Client/Server developer
http://www.erols.com/dparsons
Chow Hoi Ka, Eric <d951686@sftw.umac.mo> wrote in message
news:37494F8D.1DACDF65@sftw.umac.mo...
> Hello,
>
> How can I eject or close the CD-ROM ???
>
>
> Best regards,
> Eric
> --
> _ _
> / ) |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ( \
> / / | | \ \
> _( /_ | _ Chow Hoi Ka, Eric _ | _) )_
> (((\ \> |/ ) ( \| </ /)))
> (\\\\ \_/ / E-Mail : d951686@sftw.umac.mo \ \_/ ////)
> \ / \ /
> \ _/ http://www.sftw.umac.mo/~d951686/ \_ /
> / / |____________________________________________| \ \
> / / \ \
>
>
Technical Details
Message-ID:
<7ibnoj$aob$1@autumn.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37494F8D.1DACDF65@sftw.umac.mo>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10baee,602ec8cad0942acf X-Google-Attributes: gid10baee,public X-Google-Thread: fd817,602ec8cad0942acf X-Google-Attributes: gidfd817,public X-Google-Thread: 1043cf,602ec8cad0942acf X-Google-Attributes: gid1043cf,public From: "Dave Parsons" <dparsons@erols.com> Subject: Re: How tto eject CD-ROM ? Date: 1999/05/24 Message-ID: <7ibnoj$aob$1@autumn.news.rcn.net> X-Deja-AN: 481517175 References: <37494F8D.1DACDF65@sftw.umac.mo> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@rcn.com X-Trace: 9HiiDfi1hJJYe4n1VrIeo0IQR2NhiLj4XaFIr5FLEsc= X-MSMail-Priority: Normal NNTP-Posting-Date: 24 May 1999 14:29:39 GMT Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.objectpascal