473,720 Members | 2,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Visua lBasic.Interact ion.Beep()

Thanks
Nov 22 '05 #1
10 2675
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*****@hotmai l.com> wrote in message
news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

Nov 22 '05 #2
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*****@hotmai l.com> wrote in message
news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

Nov 22 '05 #3
You could add a reference to "Microsoft Visual Basic .NET Runtime", and have
code like:
Microsoft.Visua lBasic.Interact ion.Beep();
"Evgeny Zoldin" <ez*****@hotmai l.com> wrote in message
news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

Nov 22 '05 #4
You could add a reference to "Microsoft Visual Basic .NET Runtime", and have
code like:
Microsoft.Visua lBasic.Interact ion.Beep();
"Evgeny Zoldin" <ez*****@hotmai l.com> wrote in message
news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

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

--
Michael Culley
"Evgeny Zoldin" <ez*****@hotmai l.com> wrote in message news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

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

--
Michael Culley
"Evgeny Zoldin" <ez*****@hotmai l.com> wrote in message news:uO******** ******@tk2msftn gp13.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.Visua lBasic.Interact ion.Beep()

Thanks

Nov 22 '05 #7
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.Visua lBasic.Interact ion.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.ReadLin e();
}

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

Nov 22 '05 #8
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.Visua lBasic.Interact ion.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.ReadLin e();
}

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

Nov 22 '05 #9
> 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.Visua lBasic.Interact ion.Beep()

Thanks


Try using this:

using System;
using System.Runtime. InteropServices ;

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

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

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

Similar topics

6
31816
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
433
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
9126
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
9
17026
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 access any of the Oracle tables on another machine but now I am having problems. Unfortunately, I don't remember the correct syntax for the ODBC connect string and I am hoping that is my whole problem. I am trying to connect to an Oracle 9...
0
1223
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 { public: static bool myBeep(unsigned long iFreq, unsigned long iDur) { Beep(iFreq, iDur); return true; } };//EOF Class}This is the error i'm getting:c:\src\VC7\Managed\snmKiosk\DocImage\Utils.h(10): error C3861: 'Beep':...
1
5364
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
6884
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() For i = 0 to 100: Beep(): Next
1
2253
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 table, but the other modules still get
4
9950
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? Thanks
5
29224
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 tell my some hint abouit it? -- Rafael
0
8833
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9126
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7998
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4482
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.