Playsound Alert

  • Thread starter Thread starter David Webb
  • Start date Start date
D

David Webb

Hi,

Using PlaySound in CF VB.NET, how can I have it play continuously (up
to a 3 minute limit) or until a user presses a button? I need an alert
to appear on the device when a condition is met and I want the audible
alert to loop until either 3 minutes has expired, or the user has
pressed a button - e.g. the OK button on a MessageBox displaying the
alert.

Thanks in advance!

Regards,

David.
 
You need to use two flags in your call to PlaySound
Async - so your sound plays and your application continues to execute
Loop - to continuously loop the sound

Then when you want to stop the sound, call PlaySound with a null sound name
and all wave audio will be cleared.

If you are using the OpenNETCF.WinAPI implementation the flags are defined
in the SoundFlags enumeration.
http://www.opennetcf.org/winapi.asp

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
 
Back
Top