We help IT Professionals succeed at work.
Get Started

Cannot silence a looping sound from a VB6 app

mfenske17363 asked
Last Modified: 2012-05-12
We have a legacy VB 6 app that uses the PlaySound function in winmm.dll to play .WAV files.  Some sounds are played in a loop (SND_ASYNC+SND_LOOP) while others are not.  The user silences the looping sounds by pressing a key which calls PlaySound again using a .WAV file that is empty and the options SND_PURGE + SND_NODEFAULT.

This code has worked for a long time (and continues to work) with WIndows XP 32-bit.

When run on a Windows 7 64-bit OS the single sound works as before but attempting to use the existing code to silence the looping sound does not work (the sound continues to play until the process is killed).

Anyone experience this behavior?

What is the fix for this?

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE