MessageBeep Function

Declare Function MessageBeep Lib "user32.dll" (ByVal wType As Long) As Long

Platforms: Win 32s, Win 95/98, Win NT

MessageBeep plays one of the system's associated sounds, with one exception. These sounds are some of the ones that Windows associates with certain events. However, this function can also play a beep on the computer's internal speaker. The function returns 1 if successful, or 0 if an error occured.

wType
If set to -1 (or &HFFFFFFFF), plays a beep using the computer's internal speaker. Otherwise, this is exactly one of the following flags specifying which sound to play:
MB_ICONASTERISK = &H40
Play the SystemAsterisk sound.
MB_ICONEXCLAMATION = &H30
Play the SystemExclamation sound.
MB_ICONHAND = &H10
Play the SystemHand sound.
MB_ICONQUESTION = &H20
Play the SystemQuestion sound.
MB_OK = &H0
Play the SystemDefault sound.

Example:

' Play the SystemQuestion sound.
Dim retval As Long  ' return value

retval = MessageBeep(MB_ICONQUESTION)  ' play the SystemQuestion sound

See Also: Beep
Category: Errors

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/m/messagebeep.html