Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.
BOOL MessageBeep(
[in] UINT uType
);
[in] uType
The sound to be played. The sounds are set by the user through the Sound control panel application, and then stored in the registry.
This parameter can be one of the following values.
Value | Meaning |
---|---|
0xFFFFFFFF | A simple beep. If the sound card is not available, the sound is generated using the speaker. |
|
See MB_ICONINFORMATION. |
|
See MB_ICONWARNING. |
|
The sound specified as the Windows Critical Stop sound. |
|
See MB_ICONERROR. |
|
The sound specified as the Windows Asterisk sound. |
|
The sound specified as the Windows Question sound. |
|
See MB_ICONERROR. |
|
The sound specified as the Windows Exclamation sound. |
|
The sound specified as the Windows Default Beep sound. |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
After queuing the sound, the MessageBeep function returns control to the calling function and plays the sound asynchronously.
If it cannot play the specified alert sound, MessageBeep attempts to play the system default sound. If it cannot play the system default sound, the function produces a standard beep sound using the Beep function. Starting in Windows 7, this plays a simple tone on the default sound device. See the documentation for the Beep function for further details.
The user can disable the warning beep by using the Sound control panel application.
Note To send a beep to a remote client, use the Beep function. The Beep function is redirected to the client, whereas MessageBeep is not.
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |
API set | ext-ms-win-ntuser-misc-l1-1-0 (introduced in Windows 8) |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today