Sign in to follow this  
Followers 0
Info

About MsgBox

8 posts in this topic

#1 ·  Posted (edited)

Does the MessageBox function from the WinAPI has a built-in sound-making function or does the C++ source of AutoIt include some kind of function like PlaySound after MsgBox has been called?

I'm asking this because I just used MessageBox and I heard no sound. The flags I used are MB_ICONQUESTION | MB_YESNO.

Edited by Info

Share this post


Link to post
Share on other sites



the sound made depends on the icon used i'm pretty sure it's built into windows.

you may just not have a sound set for qustions.

MsgBox(48,"Autoit","a")
MsgBox(32,"Autoit","b")
MsgBox(16,"Autoit","c")
MsgBox(64,"Autoit","d")


Global Const $MB_ICONQUESTION = 0x00000020
Global Const $MB_ICONERROR = 0x00000010
Global Const $MB_ICONINFORMATION = 0x00000040
Global Const $MB_ICONWARNING = 0x00000030


DllCall("user32.dll", "int", "MessageBox", "int", 0, "str", "a", "str", "Windows API", "uint", $MB_ICONWARNING)
DllCall("user32.dll", "int", "MessageBox", "int", 0, "str", "b", "str", "Windows API", "uint", $MB_ICONQUESTION)
DllCall("user32.dll", "int", "MessageBox", "int", 0, "str", "c", "str", "Windows API", "uint", $MB_ICONERROR)
DllCall("user32.dll", "int", "MessageBox", "int", 0, "str", "d", "str", "Windows API", "uint", $MB_ICONINFORMATION)

Share this post


Link to post
Share on other sites

So MB_ICONQUESTION has no sound :)

Share this post


Link to post
Share on other sites

So MB_ICONQUESTION has no sound :)

Do you have a sound assigned to the Question sound event?

Share this post


Link to post
Share on other sites

What do you mean?

Share this post


Link to post
Share on other sites

In Control Panel, in Sounds, each sound event is there. A MsgBox that is marked as question will trigger the sound set for Question in the sound panel. If you have no sound set for a Question Modal window event it won't play a sound.

Share this post


Link to post
Share on other sites
Posted Image

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Okay thanks

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