🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16396

Re: Eject CD

#16396
From: Remy Lebeau (TeamB)
Date: Wed, 14 May 2003 21:08
24 lines
1782 bytes
"Mirko Rajkovaca" <mirko796@ptt.yu> wrote in message
news:3ec2a399$1@newsgroups.borland.com...

> Which API function should I use to eject CD
> from CD-drive?(under win98,Me and XP)

You can use mciSendCommand() for that:

    MCI_OPEN_PARAMS OpenParams = {0};
    MCI_CLOSE_PARAMS CloseParams = {0};
    DWORD dwFlags = MCI_OPEN_TYPE | MCI_OPEN_ELEMENT;

    OpenParams.lpstrDeviceType = MCI_DEVTYPE_CD_AUDIO;
    OpenParams.lpstrElementName = "D:";    // supply the actual drive letter
of your CD-ROM

    mciSendCommand(0, MCI_OPEN, dwFlags, (DWORD)&OpenParams);
    mciSendCommand(OpenParams.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
    mciSendCommand(OpenParams.wDeviceID, MCI_CLOSE, dwFlags,
(DWORD)&CloseParams);


Gambit
Technical Details
Message-ID: <3ec2afba$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!wn14feed!wn13feed!wn12feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ec2a399$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,ef9a257b22696451
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-14 14:13:50 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ec2a399$1@newsgroups.borland.com>
Subject: Re: Eject CD
Date: Wed, 14 May 2003 14:08:09 -0700
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3ec2afba$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1052946362 207.175.226.26 (14 May 2003 14:06:02 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!wn14feed!wn13feed!wn12feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail