Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi PlaySound-Wiedergabe unterbrechen (https://www.delphipraxis.net/34817-playsound-wiedergabe-unterbrechen.html)

chkdsk 28. Nov 2004 21:30


PlaySound-Wiedergabe unterbrechen
 
Hallo!

Habe in einem Spiel die Hintergrundmusik wie folgt realisiert:

PlaySound(PChar('music'), hInstance, snd_Loop or snd_ASync or snd_Resource);


Bloß wie kann ich das ganze jetzt wieder unterbrechen?

demonscave 29. Nov 2004 01:12

Re: PlaySound-Wiedergabe unterbrechen
 
procedure TForm1.Button1Click(Sender: TObject);
begin
sndPlaySound(nil,0);
end;

Das sollte gehen...

Dani 29. Nov 2004 05:58

Re: PlaySound-Wiedergabe unterbrechen
 
Hi,

ein kurzer Blick ins Platform SDK verrät:

Zitat:

BOOL PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);

fdwSound
Flags for playing the sound. The following values are defined.

...

SND_PURGE

Sounds are to be stopped for the calling task. If pszSound is not NULL, all instances of the specified sound are stopped. If pszSound is NULL, all sounds that are playing on behalf of the calling task are stopped.
You must also specify the instance handle to stop SND_RESOURCE events.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:57 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz