Delphi-Quellcode:
procedure TForm1.Button1Click(Sender:TObject);
begin
if Button1.Caption = 'PLAY' then
begin
Application.ProcessMessages;
Button1.Caption:='STOP';
sndPlaySound('C:\1.wav', snd_Async or snd_NoDefault);
Application.ProcessMessages;
Button1Click(Button1);
end
else
begin
Button1.Caption:='PLAY'
sndPlaySound(nil, snd_sync or snd_NoDefault);
end;
end;
Vielleicht hilft dir das ja ein wenig weiter!