-
Disabling Default Sound in NT
In the following code on the click of button 1 it starts playing a wav file
in a loop. On the click of the second button I want the wav to stop playing.
On the second click I also want the default sound disabled when clicked.
This works fine in Win95 but when I use the SND_NODEFAULT in NT it doesn't
even stop the wav from playing. This is in VB6. Does anyone have any ideas
how I can stop the wav from playing along with disabling the default sound
in NT?
-------
'Sound Constants
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
Private Declare Function sndPlaySound Lib "WINMM" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long
Private Sub Command2_Click()
Dim lRtn As Long
Dim wFlags%
'Kill Sound
wFlags% = SND_ASYNC Or SND_NODEFAULT
lRtn = sndPlaySound(vbNull, wFlags%)
End Sub
Private Sub Command1_Click()
Dim lRtn As Long
Dim wFlags%
'Play Sound Asynchronously
wFlags% = SND_ASYNC Or SND_LOOP
lRtn = sndPlaySound("G:\Dev\SndTest\Default.wav", wFlags%)
End Sub
-
Re: Disabling Default Sound in NT
> This works fine in Win95 but when I use the SND_
> NODEFAULT in NT it doesn't even stop the WAV from
> playing.
Drew: Try making your wFlags variables Longs instead of Integers and see if
it helps.
---
Phil Weber
-
Re: Disabling Default Sound in NT
> This works fine in Win95 but when I use the SND_
> NODEFAULT in NT it doesn't even stop the WAV from
> playing.
Drew: Try making your wFlags variables Longs instead of Integers and see if
it helps.
---
Phil Weber
-
Re: Disabling Default Sound in NT
Nope...that didn't seem to have any effect on it.
"Phil Weber" <pweber@teleport.com> wrote:
> This works fine in Win95 but when I use the SND_
> NODEFAULT in NT it doesn't even stop the WAV from
> playing.
Drew: Try making your wFlags variables Longs instead of Integers and see if
it helps.
---
Phil Weber
-
Re: Disabling Default Sound in NT
Nope...that didn't seem to have any effect on it.
"Phil Weber" <pweber@teleport.com> wrote:
> This works fine in Win95 but when I use the SND_
> NODEFAULT in NT it doesn't even stop the WAV from
> playing.
Drew: Try making your wFlags variables Longs instead of Integers and see if
it helps.
---
Phil Weber
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks