|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
The PlaySoundfunction also plays sounds that are referred to by a key name in the registry. Using this feature, you can let users assign selected or custom sounds to system alerts and warnings. Sounds that are associated with system alerts and warnings are called sound events.
To play a sound event
The following code example shows how to use PlaySoundto play a sound event.
PlaySound (TEXT("MouseClick"), NULL, SND_SYNC);
Note PlaySoundplays the default system sound if the registry entry that is specified in pszSounddoes not exist, or if the sound file cannot be stored in available device memory.
The sndPlaySoundfunction searches the registry for a key name that matches the lpszSoundNameparameter, before sndPlaySoundattempts to load a file that has a file name that matches lpszSoundName. The PlaySoundfunction accepts flags that specify the location of the sound.
Last updated on Tuesday, May 18, 2004