Beeping -- HELP

xcorp

Freshman
Joined
Jul 10, 2003
Messages
35
Location
bc canada
I know this is quite a simple question and I thought I knew it myself.

But...

How do you make your computer beep? I have all sorts of applications where I quick lil' beep to show it acknowledged it would be great.

I thought the command was..

Beep()


Is it not?

Please help! I've searched the "INDEX" and "HELP" sections but I've came up with the same thing.

Beep() with a few or more modificatinos for tone.


S.O.S!!
 
Thanks, I think it works. But i'm still having a bit of trouble.

I declared the following

Private Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long

and then used "messagebeep (0)" whereever I want the beep.

As it said in the instructions... but.. I still get no beep.

hehe . I know I'm a dumbass. But bare with me!
 
Make wType an Int32 rather than a Long, and make it return an Int32 as well.
 
I feel sort of emberassed because I'm not THAT stupid. But..

When it comes to this stuff it just dont seem to click. I know your probably rolling your eyes goin.. "What a stupid kid.." but i have not much experience and I'm trying to learn.

So far. I've changed the most of what I understood you for.

Private Declare Function MessageBeep Lib "user32" (ByVal wType As Int32) As Long

Is that what I was sopposed to change?

I was thinking of changing the "as long" at the end to "as int32" but..

that didn't work either

Sorry man! if you dont have the patients, I understand. But I dunno wherelse to go. lol

Thanks!!
 
Do you have the sound scheme on your system turned off? That's what the MessageBeep API uses.
 
If you want the motherboard's speaker to beep (the one inside your case), use:
Private Declare Function MessageBeep Lib "kernel32" (ByVal frequency As Int32, ByVal duration As Int32) As Int32

and call it with something like:
Beep(3000, 250)

The 250 is milliseconds (about a quarter second, the most I can stand of that tinny speaker) :)

I think the Microsof.VisualBasic namespace contains a Beep function that uses that as well.

-nerseus
 
strange, the MessageBeep api should do the trick, i just did this ...
Visual Basic:
Private Declare Function MessageBeep Lib "user32.dll" (ByVal wType As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    MessageBeep(0)
End Sub
no problems.
 
Wow.. You guys are all confusing the heck out of me.

hahaha -- I'm not that experienced.

Anyway, I tryed your example volteface. right to the dot.. Of course including all the other source that is automaticly generated, and it dont work for me.. I dont have a motherboard speaker? lol.. I know a bunch about computers, just not programming (YET) And I'm sure I have an inboard speaker.

I have no ideas... Probably a missing dll or something?
 
just do this

Visual Basic:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Integer, ByVal dwDuration As Integer) As Integer

' in the actuall event put this,

beep (100, 100)

' the first 100 represents the pitch (how high or low the beep sounds) and the second represents how long it is (100 a good length)
 
Back
Top