Einzelnen Beitrag anzeigen

Daniel B
(Gast)

n/a Beiträge
 
#1

Midi-Dateien abspielen (ohne MediaPlayer)

  Alt 30. Jan 2003, 23:22
Delphi-Quellcode:
uses
  MMSystem;

type
  TForm1 = class(TForm)
  private
    procedure MMMCINotify(var Msg: TMessage); message MM_MCINOTIFY;
  // ...
  end;

procedure TForm1.Button1Click;
const
  FileName = 'C:\YourFile.mid';
begin
  MCISendString(PChar('play ' + FileName + ' notify alias sound'), nil, 0, Handle);
end;

procedure TForm1.MMMCINotify(var Msg: TMessage);
begin
  MCISendString('close sound', nil, 0, 0);
end;
Von d3g!

Grüsse, Daniel
  Mit Zitat antworten Zitat