For Newbie

Tuesday, 15 November 2011

Open Close CD room by Delphi





Give commands to the CD-Drive for opening / closing CD room

Declaration procedure:
const
   T_open= 1;
   T_close = 2;

CDroom procedure (stat: Byte);
begin
   case Stat of
   T_open: mciSendString ('Set cdaudio door open wait', nil, 0, Application.Handle);
   T_close: mciSendString ('Set cdaudio door closed wait', nil, 0, Application.Handle);
   end;
end;

Example of implementation:
/ / Opens
procedure TForm1.Button1Click (Sender: TObject);
begin
   CDroom (T_opem);
end;

/ / Closing
procedure TForm1.Button2Click (Sender: TObject);
begin
   CDroom (T_close);
end;

Share on Facebook
Share on Twitter
Share on Google+

Related : Open Close CD room by Delphi