?
Solved

Closing CD-ROM tray

Posted on 1999-01-07
7
Medium Priority
?
216 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 40 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
Industry Leaders: 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

762 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