xcorp Posted November 4, 2003 Posted November 4, 2003 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!! Quote X-Corp Take a hit
*Experts* Volte Posted November 4, 2003 *Experts* Posted November 4, 2003 [api]MessageBeep[/api] API. Quote
xcorp Posted November 4, 2003 Author Posted November 4, 2003 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! Quote X-Corp Take a hit
*Experts* Volte Posted November 4, 2003 *Experts* Posted November 4, 2003 Make wType an Int32 rather than a Long, and make it return an Int32 as well. Quote
xcorp Posted November 4, 2003 Author Posted November 4, 2003 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!! Quote X-Corp Take a hit
*Experts* Volte Posted November 4, 2003 *Experts* Posted November 4, 2003 Do you have the sound scheme on your system turned off? That's what the MessageBeep API uses. Quote
*Experts* Nerseus Posted November 4, 2003 *Experts* Posted November 4, 2003 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 Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Leaders dynamic_sysop Posted November 4, 2003 Leaders Posted November 4, 2003 strange, the MessageBeep api should do the trick, i just did this ... 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. Quote
*Experts* jfackler Posted November 4, 2003 *Experts* Posted November 4, 2003 Do you need to reference and import user32.dll? Quote
Administrators PlausiblyDamp Posted November 4, 2003 Administrators Posted November 4, 2003 user32.dll is a 'normal' dll and as such doesn't need to be registered or referernced or imported etc. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
xcorp Posted November 5, 2003 Author Posted November 5, 2003 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? Quote X-Corp Take a hit
*Experts* jfackler Posted November 5, 2003 *Experts* Posted November 5, 2003 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 Quote
coco_3010 Posted November 10, 2003 Posted November 10, 2003 just do this 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) Quote
xcorp Posted November 12, 2003 Author Posted November 12, 2003 All good thanks for your help guys! Quote X-Corp Take a hit
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.