CD-ROM 열고 닫기
2011.12.22 01:19
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
MPlayer, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
MediaPlayer1: TMediaPlayer;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses MmSystem;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
with MediaPlayer1 do
if (MediaPlayer1.Mode = mpOpen) then
mciSendCommand(MediaPlayer1.DeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0)
else
mciSendCommand(MediaPlayer1.DeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
end;
end.