If I wana beep in my console program, I just need use "BOOL MessageBeep(UNIT nType)", which is illustrated as follows.
#include <windows.h>
int main()
{
for ( UINT i=0; i<100; i++ )
{
MessageBeep(i);
Sleep(1000);
}
return 0;
}It shall beep differently in every second.

本文介绍如何利用C++编程语言中的BOOLMessageBeep函数实现一个简单的控制台程序,该程序每秒钟发出不同声音提示。通过循环调用MessageBeep函数并传入不同的参数,可以实现每秒播放不同音效的效果。
3893

被折叠的 条评论
为什么被折叠?



