CDROM Otomatis

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, ExtCtrls;

type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
timeOver : word;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
MediaPlayer1.DeviceType:=dtCDAudio;
MediaPlayer1.Open;
MediaPlayer1.Play;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if timeOver = 15 then
begin
MediaPlayer1.Eject;
MediaPlayer1.Close;
Timer1.Enabled:=false;
ShowMessage(‘CD ROM terbuka’);
end else
inc(timeOver);
end;

end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: