Jump to content

Suppressing Msgbox sound


muncherw
 Share

Recommended Posts

When a message box pops up from an AutoIt script Windows beeps at you to alert you the box is there. I'd like to prevent that sound from happening when I use msgbox. I realize this is a function of Windows and not of the msgbox function but I'm sure creative scripting has a way around it. I'd like to prevent that sound from happening when I use msgbox.

I was looking at an example script for something unrelated that popped up like 30 msgboxes in a row and it made someone near my desk a little agitated. I shot him with a rubber band but that didn't seem to solve anything.

My initial idea was to use Volley's sound UDF and just mute the sound before a msgbox and unmute after but that really puts a damper on listening to music. I could change the windows scheme to not have a sound for that event (Default Beep) but I don't really want to do that as sometimes it is useful to get that beep.

Any suggestions?

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

  • Developers

Create your own _MsgBox() Func in which you create the MSGBOX with a GuiCreate() ...

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I found this on Google: http://www.wpuniverse.com/vb/showthread.php?threadid=27776

It basically tells you to change the sound in the Sound panel from Configuration, by registry editing. Or set the wave volume to 0.

I would go with the sound in control panel as well, show the messagebox, then immediately put the sound back to what it was.

Link to comment
Share on other sites

Here is what I came up with based on Manadar's idea of turning off in the registry.

RegWrite("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\.Default\.Current", "", "REG_EXPAND_SZ", "")

MsgBox(0, "Quiet", "You can't hear this")

RegWrite("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\.Default\.Current", "", "REG_EXPAND_SZ", "%SystemRoot%\media\Windows XP Ding.wav")

ResNullius-

Saw your answer while I was typing this. I'll check it out.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

But you're blocking the overall volume for someone listening to music maybe? Use Jos's idea and make your own custom message box. It's consisting from an image with text and title. Making it a modal or modeless isn't difficult at all. Don't forget optional arguments... ';]

Edit: Bad me lol, it's not an overall volume ... "think before posting"... :)

Edited by Authenticity
Link to comment
Share on other sites

But you're blocking the overall volume for someone listening to music maybe? Use Jos's idea and make your own custom message box. It's consisting from an image with text and title. Making it a modal or modeless isn't difficult at all. Don't forget optional arguments... ';]

Mine only turns off the Default Beep noise. You can still play music and still get all other system sounds. It works well.

Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Link to comment
Share on other sites

@muncherw

Its better to replace the good path according to the sound because it can change if youve installed packs or something else..

$sndpath = RegRead('HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\.Default\.Current', '')  
RegWrite('HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\.Default\.Current', '', 'REG_EXPAND_SZ', '')

MsgBox(0, 'Quiet', 'You can't hear this')
RegWrite("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\.Default\.Current", '', 'REG_EXPAND_SZ', $sndpath)

Cheees, FireFox.

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