Beeping -- HELP

xcorp

Active member
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! Ive searched the "INDEX" and "HELP" sections but Ive came up with the same thing.

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


S.O.S!!
 
Thanks, I think it works. But im 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 Im 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 Im 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 Im trying to learn.

So far. Ive 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 didnt 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? Thats what the MessageBeep API uses.
 
If you want the motherboards 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 ...
Code:
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 -- Im 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 Im sure I have an inboard speaker.

I have no ideas... Probably a missing dll or something?
 
X,
Take a look here , doing some modification of the example using the windows media player msdxm.ocx com lets you play any sound file you would like in an event.

Jon
 
just do this

Code:
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