procedure MCINOTIFY(Var Message:TMessage);
message MM_MCINOTIFY;
function SendMCIStr(const Value: String)
Char;
-----------------------------------
procedure TForm1.MCINOTIFY(var Message: TMessage);
begin
if (SendmciStr('Status mid mode')='stopped') then
begin
sendmcistr('seek mid to start');
sendmcistr('play mid notify');
end;
end;
function TForm1.SendMCIStr(const Value: String)
Char;
Var Buf:Array[0..4095] of char;
begin
MCISendString(PChar(Value),Buf,Sizeof(Buf),Handle);
Result:=Buf;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
filename:string;
begin
filename:=extractfilepath(application.ExeName)+'happy.mid';
SendMciStr('Open '+filename+' alias mid');
SendMciStr('Play mid notify');
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
sendmcistr('close mid');
end;