--> Open Close CD room by Delphi | Delphi Tips Trick

For Newbie

Tuesday, 15 November 2011

Open Close CD room by Delphi

| Tuesday, 15 November 2011




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;

Related Posts

No comments: