Is there a way of playing system sounds other than the standard Beep, for example the menuclick or exit windows sound, or atleast fing the files so I can use PlaySound.
Thanks in advance.
Printable View
Is there a way of playing system sounds other than the standard Beep, for example the menuclick or exit windows sound, or atleast fing the files so I can use PlaySound.
Thanks in advance.
Paste this into a module:
Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_SYNC = &H0 ' play synchronously (default)
Public Const SND_ASYNC = &H1 ' play asynchronously
Public Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Paste this into a form with a single button:
Private Sub Command1_Click()
sndPlaySound ByVal "C:\Sound.wav", &H1
End Sub
Sure. You can specify registry entry for the sound event.
Here are default predifined system names:Code:Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Sub Command1_Click()
PlaySound "SystemExit", 0&, SND_ASYNC
End Sub
SystemAsterisk
SystemExclamation
SystemExit
SystemHand
SystemQuestion
SystemStart
Good luck
thanks.