MessageBeep Function

来源:互联网 发布:绿标网址域名防红跳转 编辑:程序博客网 时间:2024/06/14 17:13

MessageBeep Function

 

Plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.

 

BOOL WINAPI MessageBeep(  __in          UINT uType);

Parameters

uType

The sound type, as identified by an entry in the registry. This parameter can be one of the following values.

ValueMeaning

-1

Simple beep. If the sound card is not available, the sound is generated using the speaker.

Note that this value is resolved to 0xFFFFFFFF within the function.

MB_ICONASTERISK
0x00000040L

SystemAsterisk

MB_ICONEXCLAMATION
0x00000030L

SystemExclamation

MB_ICONHAND
0x00000010L

SystemHand

MB_ICONQUESTION
0x00000020L

SystemQuestion

MB_OK
0x00000000L

SystemDefault

Return Value

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.

Remarks

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 through the computer speaker.

The user can disable the warning beep by using the Sound control panel application.

Terminal Services:  To send a beep to a client, use the Beep function. The Beep function is redirected to the client, whereas MessageBeep is not, except on Windows NT 4.0 where MessageBeep(-1) calls Beep.

Example Code

For an example, see Notifying the User of Errors.

Requirements

Client

Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.

Server

Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server.

Header

Declared in Winuser.h; include Windows.h.

Library

Use User32.lib.

DLL

Requires User32.dll.

See Also

Beep
Error Handling Functions
FlashWindow
Notifying the User


Send comments about this topic to Microsoft

Build date: 8/10/2007

原创粉丝点击