Tuesday, 15 November 2011
Home »
Tips and Trick Delphi
» Open Close CD room by Delphi
Open Close CD room by Delphi
To Share | 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;
No comments:
Post a Comment