steveR Posted March 6, 2005 Share Posted March 6, 2005 How do I play the Window's beep using Send() ? I tried Send("{asc 07}") send(chr(7)) $bel = 7 send ("{" & $bel & "}") and some others or isn't it possible? AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
Matt_J Posted March 6, 2005 Share Posted March 6, 2005 Hi,Try win32 MessageBeep from user32.dll MessageBeep()Script below, use one of the constants as the last argument to DllCall()Cheers,Matt_J;Define Value Sound Alias ;Default beep -1 ;MB_OK 0x00 SystemDefault ;MB_ICONHAND 0x10 SystemHand ;MB_ICONQUESTION 0x20 SystemQuestion ;MB_ICONEXCLAMATION 0x30 SystemExclamation ;MB_ICONASTERISK 0x40 SystemAsterisk ;call BOOL MessageBeep(UINT uType); DllCall ( "user32.dll", "int", "MessageBeep", "int", 0x01) Taken a Turing test lately? Link to comment Share on other sites More sharing options...
steveR Posted March 6, 2005 Author Share Posted March 6, 2005 (edited) Yeah i was looking at that too, but i can't get that to work either EDIT: OK i got 0x10, 30, and 40 to work. Thats good enough for now. Thanks for your help. Edited March 6, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
Matt_J Posted March 6, 2005 Share Posted March 6, 2005 (edited) Your volume and speakers ok, and sounds setup in control panel? The default beep of -1 runs the speaker if there is no soundcard. Is DllCall succeeding? Try below. Edit: Some sounds probably don't work because they are disabled in control panel sound scheme. I've been known to turn all the sounds off at times. DllCall ( "user32.dll", "int", "MessageBeep", "int", -1) if @error then msgbox(1,'Error','MessageBeep failed ') Edited March 6, 2005 by Matt_J Taken a Turing test lately? Link to comment Share on other sites More sharing options...
kwlayman Posted March 22, 2005 Share Posted March 22, 2005 A little off subject, but does anyone know how to keep the AutoIT msgbox from sounding a system beep?I've turned all sounds off and even uninstalled my laptop speaker and it STILL BEEPS loudly.Your volume and speakers ok, and sounds setup in control panel?The default beep of -1 runs the speaker if there is no soundcard.Is DllCall succeeding? Try below.Edit: Some sounds probably don't work because they are disabled in control panel sound scheme.I've been known to turn all the sounds off at times. DllCall ( "user32.dll", "int", "MessageBeep", "int", -1) if @error then msgbox(1,'Error','MessageBeep failed ')<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
phillip123adams Posted March 22, 2005 Share Posted March 22, 2005 A little off subject, but does anyone know how to keep the AutoIT msgbox from sounding a system beep?I've turned all sounds off and even uninstalled my laptop speaker and it STILL BEEPS loudly.<{POST_SNAPBACK}>Some Flag values do not produce sound. For example 32. Although not documented, Flag 128 does not produce Sound and can be combined with other Flag values to produce various buttons. However, the results are not always as anticipated. For example 128 + 16 does not produce a message box with a stop sign. Perhaps this is a bug, or perhaps 128 should not be relied upon. I'll report it as missing in the doc.Here are a few examples without sound.expandcollapse popupMsgBox(32, "test", "32 = No sound, but question mark icon") MsgBox(33, "test", "33 = No sound, but question mark icon") MsgBox(34, "test", "34 = No sound, but question mark icon") MsgBox(35, "test", "35 = No sound, but question mark icon") MsgBox(36, "test", "36 = No sound, but question mark icon") MsgBox(37, "test", "37 = No sound, but question mark icon") MsgBox(38, "test", "38 = No sound, but question mark icon") MsgBox(128, "test", "128 = No sound, but space for icon") MsgBox(129, "test", "129 = No sound, but space for icon") MsgBox(130, "test", "130 = No sound, but space for icon") MsgBox(131, "test", "131 = No sound, but space for icon") MsgBox(132, "test", "132 = No sound, but space for icon") MsgBox(133, "test", "133 = No sound, but space for icon") MsgBox(134, "test", "134 = No sound, but space for icon") ; based upon 128 + 16... MsgBox(144, "based upon 128 + 16", "144 = No sound, no icon") MsgBox(145, "based upon 128 + 16", "145 = No sound, no icon") MsgBox(146, "based upon 128 + 16", "146 = No sound, no icon") MsgBox(147, "based upon 128 + 16", "147 = No sound, no icon") MsgBox(148, "based upon 128 + 16", "148 = No sound, no icon") MsgBox(149, "based upon 128 + 16", "149 = No sound, no icon") MsgBox(150, "based upon 128 + 16", "150 = No sound, no icon") ; based upon 128 + 32... MsgBox(160, "based upon 128 + 32", "160 = No sound, no icon") MsgBox(161, "based upon 128 + 32", "161 = No sound, no icon") MsgBox(162, "based upon 128 + 32", "162 = No sound, no icon") MsgBox(163, "based upon 128 + 32", "163 = No sound, no icon") MsgBox(164, "based upon 128 + 32", "164 = No sound, no icon") MsgBox(165, "based upon 128 + 32", "165 = No sound, no icon") MsgBox(166, "based upon 128 + 32", "166 = No sound, no icon") ; based upon 128 + 48... MsgBox(176, "based upon 128 + 48", "176 = No sound, no icon") ; based upon 128 + 64... MsgBox(192, "based upon 128 + 64", "192 = No sound, no icon") Phillip Link to comment Share on other sites More sharing options...
sylvanie Posted March 22, 2005 Share Posted March 22, 2005 Hello, If you want to make a "beep", you can also use : Run(@ComSpec & " /c "&chr(7),"",@SW_HIDE) Bye Link to comment Share on other sites More sharing options...
steveR Posted March 22, 2005 Author Share Posted March 22, 2005 (edited) Hello,If you want to make a "beep", you can also use :Run(@ComSpec & " /c "&chr(7),"",@SW_HIDE)ByeThanks sylvanie. I tried using chr(7) with the Send() command but could'nt make it work. And it's easier than a api call. Edited March 22, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now