unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MMSystem, ExtCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
IsOpen: boolean;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if IsOpen = false then
begin
mciSendString('Set cdaudio door open wait', nil, 0, handle);
IsOpen:=true;
end
else
begin
mciSendString('Set cdaudio door closed wait', nil, 0, handle);
IsOpen:=false;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
IsOpen := false;
end;
end.
Копирайт © 2007, Lanselot. Все права защищены.