A
Andy
Hi,
I have an application that has several forms. Each form acts as a
monitor of a gateway system. If the gateway appears to be dead, the
application should play a .wav file (not resource) until the user
clicks a button to acknowledge the situation. To keep things simple,
lets assume there is only one monitor.
If I use the old sndPlaySound function, with the code:
SND_ASYNC = &H1
SND_LOOP = &H8
'Gateway Failed - Sound the alarm.
sndPlaySound(strFileName, SND_ASYNC OR SND_LOOP)
MessageBox.Show("Check Gateway!")
MessageBox.Show("Resume Monitor?")
sndPlaySound(Nothing, &H2)
the wav file is played in a loop until the user the user responds to
the second MessageBox.
However, if I use the preferred (because its newer) PlaySound function
with the code:
PlaySound(strFileName, Nothing, SND_ASYNC OR SND_LOOP)
MessageBox.Show("Check Gateway!")
MessageBox.Show("Resume Monitor?")
PlaySound(Nothing, Nothing, &H2)
The wav file is played just once and the first message box is
displayed.
Can anyone tell me how I should fiddle with the PlaySound parameters to
get this working?
My guess is that the sound produced when the message box is displayed
is clearing the the wav file when the PlaySound function is used. For
some reason, this does not happen with the sndPlaySound function.
If it helps, my next question will be how do I play two alarms at the
same time i.e. if two gateways fail simultaneously how do I prevent the
second alarm from purging the first alarm?
Thanks in advance,
Andy
I have an application that has several forms. Each form acts as a
monitor of a gateway system. If the gateway appears to be dead, the
application should play a .wav file (not resource) until the user
clicks a button to acknowledge the situation. To keep things simple,
lets assume there is only one monitor.
If I use the old sndPlaySound function, with the code:
SND_ASYNC = &H1
SND_LOOP = &H8
'Gateway Failed - Sound the alarm.
sndPlaySound(strFileName, SND_ASYNC OR SND_LOOP)
MessageBox.Show("Check Gateway!")
MessageBox.Show("Resume Monitor?")
sndPlaySound(Nothing, &H2)
the wav file is played in a loop until the user the user responds to
the second MessageBox.
However, if I use the preferred (because its newer) PlaySound function
with the code:
PlaySound(strFileName, Nothing, SND_ASYNC OR SND_LOOP)
MessageBox.Show("Check Gateway!")
MessageBox.Show("Resume Monitor?")
PlaySound(Nothing, Nothing, &H2)
The wav file is played just once and the first message box is
displayed.
Can anyone tell me how I should fiddle with the PlaySound parameters to
get this working?
My guess is that the sound produced when the message box is displayed
is clearing the the wav file when the PlaySound function is used. For
some reason, this does not happen with the sndPlaySound function.
If it helps, my next question will be how do I play two alarms at the
same time i.e. if two gateways fail simultaneously how do I prevent the
second alarm from purging the first alarm?
Thanks in advance,
Andy