Solved

Closing CD-ROM tray

Posted on 1999-01-07
7
208 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now