Page 1 of 1

Load/Eject functions for optical drives.

Posted: 09.03.2011, 10:58
by artman
Hi, I'd really love to see Load/Eject functions for optical drives.
For example, when a drive has selection on it (Alt+F1/F2) user can press [Del]/[Insert] buttons and it will work as Eject/Load correspondingly.

Re: Load/Eject functions for optical drives.

Posted: 04.04.2011, 00:10
by stedanarh
This is the code to do this:

Code: Select all

Uses MMSystem;

procedure TForm1.Button1Click(Sender: TObject);
begin
  MCISendString ('Set CDAudio Door Open Wait', Nil, 0, Handle);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  MCISendString ('Set CDAudio Door Closed Wait', Nil, 0, Handle);
end;