The SND_PURGE flag for the PlaySound API doesn't seem to purge the .wav file thats currently playing. It works on Win 95, 98. Does anyone know if the SND_PURGE Flag is supported on Windows 2000. Can't seem to find any docs stating this.
Printable View
The SND_PURGE flag for the PlaySound API doesn't seem to purge the .wav file thats currently playing. It works on Win 95, 98. Does anyone know if the SND_PURGE Flag is supported on Windows 2000. Can't seem to find any docs stating this.
I took this from a NewsGroup letterFrom what I've discovered, there is a bug, but not with the API itself, but rather how it works with VB on Windows 2000. From what I've read, if you were writing code in C, and running it on Windows 2000, it would work just fine.Quote:
You seem to be correct. The only way to stop the sound in Win2000
using PlaySound is to start a new silent "sound".
You can try this:VB Code:
rc = PlaySound("", ByVal 0&, SND_NODEFAULT Or SND_MEMORY)
rc indicates an error (rc = 0) but the sound stops.
See if passing a blank filename helps
I was using the BLANK .Wav file and it worked just finr. However, after continuous looping files starting and stoping the system seemed to really bog down and eventually come to a halt. I started setting the SND_FILENAME Flag which I believe cured my problem.SND_FILENAME seems to stop the system from searching the registry.
Thanks for the input. VBNull also works as the filename but causes the SystemDefault Sound.