Sign in to follow this  
Followers 0
muncherw

Suppressing Msgbox sound

10 posts in this topic

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]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks for the ideas. I'll look into both options and post something when I get something.


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]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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..

Good call, thanks. I'll change that.


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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0