473,324 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Any call in C# like Beep in VB.Net

Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks
Nov 15 '05 #1
6 1628
YOu can PInvoke PlaySound and fire the beep wave file. However, Interaction
is made for situations like this, and you don't lose anything by using it.
All it does is wrap that API anyway from what I've been told.

HTH,

Bill
"Evgeny Zoldin" <ez*****@hotmail.com> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks

Nov 15 '05 #2
You could add a reference to "Microsoft Visual Basic .NET Runtime", and have
code like:
Microsoft.VisualBasic.Interaction.Beep();
"Evgeny Zoldin" <ez*****@hotmail.com> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks

Nov 15 '05 #3
I've never done it but I presume you can call the MessageBeep API

--
Michael Culley
"Evgeny Zoldin" <ez*****@hotmail.com> wrote in message news:uO**************@tk2msftngp13.phx.gbl...
Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks

Nov 15 '05 #4
If you're going to go to all that trouble, why not just
stand behind their chair and yell "BEEP!"? ;D
-----Original Message-----
YOu can PInvoke PlaySound and fire the beep wave file. However, Interactionis made for situations like this, and you don't lose anything by using it.All it does is wrap that API anyway from what I've been told.
HTH,

Bill
"Evgeny Zoldin" <ez*****@hotmail.com> wrote in message
news:uO**************@tk2msftngp13.phx.gbl...
Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks

.

Nov 15 '05 #5
Evgeny Zoldin wrote:
Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks


Evgeny,

quickest way i can think of is echo control-g (ascii7), ie, if you're
creating a Console App :)

namespace BeepApp {
class BeepManager {
[STAThread]
static void Main(string[] args) {
BeepManager bm = new BeepManager();
bm.Beep();
Console.ReadLine();
}

public void Beep() {
Console.WriteLine((char)7);
}
}
}

Nov 15 '05 #6
> Hi All,

Does anybody know is it possible in C# call a Beep for system speaker like
that one in VB but different from
Microsoft.VisualBasic.Interaction.Beep()

Thanks


Try using this:

using System;
using System.Runtime.InteropServices;

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

public static void Main(string[] args)
{
Beep(1000,1000);
}
}
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Leo | last post by:
hi there i want python to do a beep. in the docu i found in tkinter the method bell() but the script: import Tkinter Tkinter.bell() gives the error:
5
by: Evgeny Zoldin | last post by:
Hi All, Does anybody know is it possible in C# call a Beep for system speaker like that one in VB but different from Microsoft.VisualBasic.Interaction.Beep() Thanks
8
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
0
by: senimu | last post by:
Hi there,I'm trying to call from managed C++ code very simple API functionBOOL Beep( DWORD dwFreq, DWORD dwDuration );Something like this:namespace DocImage { public __gc class cBeep { ...
1
by: senimu | last post by:
Hi there, I'm trying to call very simple API function from managed C++ code BOOL Beep( DWORD dwFreq, DWORD dwDuration ); Something like this: namespace DocImage {
4
by: Rich | last post by:
Hello, I want to use the Beep() to alert users about certain messages but in my workstation I can't get a sound out of it. But Beep works in VB6. What do I need to do? Sub... .... Beep()...
1
by: pob | last post by:
>From a form I have some code that calls 4 modules frmMain 1 mod 2 mod 3 mod 4 mod If mod 1 experiences an error the error handling works fine within mod 1 and writes out the error to a...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
When I press the Enter key in a Textbox I get a beep sound. But when I press the Enter key in a combobox, I don't get the beep sound. Is there a way to suppress the beep? How to do this? ...
5
by: =?Utf-8?B?UmFmYWVs?= | last post by:
I'm studying C# (I've been a VB developer). I'm making some tests and I need to use Console.Beep(), but it doesn't make any sound, no matter if I try it in VS2008 beta or VS2005. Could anybody...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.