unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
Menus, ExtCtrls, ComCtrls, Buttons, StdCtrls, Unit2, mmSystem;
type
{ TForm1 }
TForm1 = class(TForm)
EndeBtn: TButton;
OptionenBtn: TButton;
StartenBtn: TButton;
Panel1: TPanel;
procedure EndeBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure OptionenBtnClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure PlayMySound(SndName: String); //uses mmSystem
var
FilePath: String;
begin
FilePath := ExtractFilePath(ParamStr(0)) +'Musik\' + SndName + '.wav';
if FileExists(FilePath) then
//SndPlaySound(PAnsiChar(FilePath), SND_ASYNC ); //Alternative
PlaySound(PChar(FilePath), hInstance, SND_ASYNC or SND_FILENAME);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
procedure TForm1.EndeBtnClick(Sender: TObject);
begin
close;
end;
procedure TForm1.OptionenBtnClick(Sender: TObject);
begin
Form2.ShowModal;
PlayMySound('Modem');
end;
end.