Jump to content

send command bel


Recommended Posts

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

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. :lmao:

DllCall ( "user32.dll", "int", "MessageBeep", "int", -1)
if @error then msgbox(1,'Error','MessageBeep failed ')
Edited by Matt_J

Taken a Turing test lately?

Link to comment
Share on other sites

  • 3 weeks later...

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

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.

MsgBox(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

Hello,

If you want to make a "beep", you can also use :

Run(@ComSpec & " /c "&chr(7),"",@SW_HIDE)

Bye

Thanks 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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...