|
-
Apr 11th, 2000, 09:56 PM
#1
Thread Starter
Frenzied Member
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.
-
Apr 11th, 2000, 10:10 PM
#2
Fanatic Member
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
-
Apr 11th, 2000, 10:25 PM
#3
Sure. You can specify registry entry for the sound event.
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
Here are default predifined system names:
SystemAsterisk
SystemExclamation
SystemExit
SystemHand
SystemQuestion
SystemStart
Good luck
-
Apr 11th, 2000, 10:49 PM
#4
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|