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

Related Call: Beep
Category: Errors
Back to the index.


Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/m/messagebeep.html