Send beeps/tones to CE 4.2 scanner device
How can I tell the windows mobile CE 4.2 device to raise a certain beep
tone. Is this possible? When the user is scanning bar codes, they may not
be looking at the screen for errors. I'd like to raise an "Error" tone so
the user can audibly hear there was an input error and then look on to the
display for intructions. Has anyone tried this?
Date:Mon, 23 Jul 2007 16:03:37 -0400
Author:
|
Re: Send beeps/tones to CE 4.2 scanner device
You can P/Invoke MessageBeep (see the SDK for details) to play default beep
noises, or PlaySound to play any .wav file. There are also third-party
wrapper classes, I wrote SystemSounds and SoundPlayer classes for .NETCF
which appear in Mobile In The Hand
(http://inthehand.com/content/Mobile.aspx) and elsewhere. The P/Invokes are
below:-
[DllImport("coredll.dll", EntryPoint="MessageBeep", SetLastError=true)]
private static extern void MessageBeep(int type);
usage:-
MessageBeep(0);
[DllImport("coredll.dll", EntryPoint="PlaySoundW", SetLastError=true) ]
private extern static bool PlaySound(string lpszName, IntPtr hModule, int
dwFlags);
usage:-
PlaySound("\\windows\\mywav.wav", IntPtr.Zero, 0x20000);
Peter
--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility
"Dan" wrote in message
news:O3LRwSWzHHA.3940@TK2MSFTNGP05.phx.gbl...
> How can I tell the windows mobile CE 4.2 device to raise a certain beep
> tone. Is this possible? When the user is scanning bar codes, they may
> not be looking at the screen for errors. I'd like to raise an "Error"
> tone so the user can audibly hear there was an input error and then look
> on to the display for intructions. Has anyone tried this?
>
Date:Mon, 23 Jul 2007 21:32:34 +0100
Author:
|