Solved

Simple Beep on Windows Mobile

Posted on 2006-11-18
9
6,264 Views
Last Modified: 2013-12-27

Hello,

I'm developing a handheld barcode scanning application and have a textbox that accepts the input.  All is well except I would like a simple "beep" after I detect the input.

Is there a simple API call, etc. that can do this?  I don't need anything fancy like playing a wav file, etc.  (Maybe for version 2).

VS 2005 - WM 5.0 - CF 2.0 - C#

Joe
0
Comment
Question by:jkanisut
9 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 17973053
try
Beep()
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 200 total points
ID: 17973054
c#

Beep();
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 17973055
http://msdn2.microsoft.com/en-us/library/8hftfeyw.aspx

Your lucky that you are using the CF2.0
0
 
LVL 1

Author Comment

by:jkanisut
ID: 17982915

Getting warmer... do you know how I can get the System.Media namespace into my CF 2.0 app?  It doesn't seem to have a reference.

Joe
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 48

Expert Comment

by:Mikal613
ID: 17983369
0
 
LVL 7

Accepted Solution

by:
CJCraft earned 300 total points
ID: 18202656
It actually might be easier to play the wav file. :)

Actually you can do the following:
Microsoft.VisualBasic.Interaction.Beep()

You just need to add a reference to Microsoft.VisualBasic.dll in the project.

Or you can p/invoke:

    [DllImport("kernel32.dll")]
    public static extern bool Beep(int freq,int duration);

0
 
LVL 1

Author Comment

by:jkanisut
ID: 18202902

Thanks... what am I doing wrong in this test program?  Getting:

System.MissingMethodException was unhandled
  Message="Can't find PInvoke DLL 'kernel32.dll'."


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Beep
{
    public partial class Form1 : Form
    {

        [DllImport("kernel32.dll")]
        public static extern bool Beep(int freq,int duration);


        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Beep(1000,1000);
        }
    }
}

0
 
LVL 1

Author Comment

by:jkanisut
ID: 18204268

This was a more detailed solution and targeted for the CF:

http://blogs.msdn.com/brada/archive/2004/06/03/148142.aspx
0
 

Expert Comment

by:derunbekannte
ID: 24244790
Works in VS08 WM5 CF 2 C#
seems to be alot easier than all that other stuff(which didn't work for me anyway)
System.Media.SystemSounds.Beep.Play();

Open in new window

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.   If you need to hide the Start Icon and/or the SIP (soft input panel, softwar…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now