Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
NOTE: The function sndPlaySound is obsolete. It is superseded by the PlaySound function.
sndPlaySound plays either a .WAV file or a system-defined sound. If the SND_NODEFAULT flag is used, the function returns 0 if the .WAV file (or system sound) cannot be found and 1 if it is. If the flag is not set, the function always returns 1 and plays the Windows Default sound if the specified sound cannot be found.
Example:
' Play the Empty Recycle Bin system sound and pause
' program execution until the sound is finished playing.
Dim retval As Long
retval = sndPlaySound("EmptyRecycleBin", SND_ALIAS Or SND_SYNC) ' play the associated sound
See Also: PlaySound
Category: Audio
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/sndplaysound.html