|
-
Jul 4th, 2000, 12:53 AM
#1
Thread Starter
Hyperactive Member
WHen I use this to play a .wav it stops the actions in the form, how could I make the .wav play, and still have the stuff in the form move?
Option Explicit
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_FILENAME = &H20000 ' name is a file name
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_SYNC = &H0
Private Sub Play_Sound_Click()
PlaySound App.Path & "\ILOVEYOUVIRUS.wav.vbs.mp3.wav.vbs.jpg.wav", 0, SND_SYNC
End Sub
-
Jul 4th, 2000, 01:21 AM
#2
Addicted Member
Play it ASYNC instead of SYNC
-
Jul 4th, 2000, 01:28 AM
#3
Thread Starter
Hyperactive Member
Thanks a lot! One more thing... what code can I use to make the sound stop when the command button function is pressed?
-
Jul 4th, 2000, 02:50 PM
#4
Thread Starter
Hyperactive Member
Im still interested in stopping it whenever they hit ok...
-
Jul 4th, 2000, 03:06 PM
#5
To stop playing a WAV:
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 Const SND_PURGE = &H40
Private Sub cmdPlay_Click()
'Play the WAV file
PlaySound "C:\MyWav.wav", 0, SND_ASYNC
End Sub
Private Sub cmdStop_Click()
'Stop the WAV file
PlaySound "", 0, SND_PURGE
End Sub
-
Jul 4th, 2000, 03:12 PM
#6
Thread Starter
Hyperactive 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
|