词条 | MessageBeep |
释义 | This function plays a waveform sound. (该函数是播放一段系统音乐) BOOL MessageBeep( UINT uType //根据不同的类型来定 ); Parameters(参数) uType Specifies the sound type, as identified by an entry in the [sounds] section of the registry. It is one of the following values. Value Description (数值描述): 0xFFFFFFFF SystemDefault (从机器的扬声器中发出蜂鸣声) MB_ICONASTERISK SystemAsterisk (播放由SystemAsterisk定义的声音) MB_ICONEXCLAMATION SystemExclamation (播放由SystemExclamation定义的声音) MB_ICONHAND SystemHand (播放由SystemHand定义的声音) MB_ICONQUESTION SystemQuestion (播放由SystemQuestion定义的声音) MB_OK SystemDefault (播放由SystemDefault定义的声音) Return Values(返回值): 1.Nonzero indicates success. (非零表示成功) 2.Zero indicates failure. (零表示不成功) 3.To get extended error information, call GetLastError.(通过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. Requirements OS Versions: Windows CE 1.0 and later. Header: Winbase.h. Link Library: Msgbeep.lib. See Also MessageBox 程序示例: #include <windows.h> int main ( int argc, char *argv[] ) { Sleep(1000); ::MessageBeep(0xFFFFFFFF);//API函数前加“::”符号,表示这是一个全局的函数,以与c++类的成员函数相区分 Sleep(1000); ::MessageBeep(MB_ICONASTERISK); Sleep(1000); ::MessageBeep(MB_ICONEXCLAMATION); Sleep(1000); ::MessageBeep(MB_ICONHAND); Sleep(1000); ::MessageBeep(MB_ICONQUESTION); Sleep(1000); ::MessageBeep(MB_OK); Sleep(1000); return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。