Solved

Closing CD-ROM tray

Posted on 1999-01-07
7
212 Views
Last Modified: 2010-04-04
How can I close CD-ROM tray, I mean the oposite method for Eject.
I use TMediaPlayer

Motaz
0
Comment
Question by:Motaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 10 total points
ID: 1355112
To close the CD-ROM:

       mciSendString('Set cdaudio door closed wait', nil, 0, handle);

OR

procedure TCDEvents.CloseDoor;
var
  SetParm: TMCI_Set_Parms;
begin
  FFlags := 0;
  FFlags := mci_notify or mci_set_door_closed;
  SetParm.dwCallback := 0;
  fErrCode := mciSendCommand( ID, mci_Set, FFlags, Longint(@SetParm) );
end;

You can get the ID from Mediaplayer.
0
 
LVL 7

Author Comment

by:Motaz
ID: 1355113
Thanks Tom
Motaz
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355114
Glad I could help you Motaz.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:Motaz
ID: 1355115
by the way ZiffNap, what is your real name, where r u from and where is experts-exchange, is it in USA in which state ?
 :)

Motaz
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355116
Hi,

Hi Motaz, my real name is Tom (thought you knew it already) and I'm from Belgium (I think you can see it also at my info (click on ZifNab).

E-E? Guess in USA. (Experts Exchange, Inc.;   406 Higuera Street, Suite 120; San Luis Obispo, CA 93401)

ID of cd can be found through mediaplayer1.DeviceID

Zif.
0
 
LVL 7

Author Comment

by:Motaz
ID: 1355117
Thanks Tom, nice to meet you
Motaz Abdel Azim from Sudan
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355118
Nice to meet you too Motaz Abdel Azim.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question