请问在vc中怎样使系统发出一声“嘟”?
尽量用简单的方法, 若有解释就谢天谢地了
尽量用简单的方法, 若有解释就谢天谢地了
解决方案 »
- 用PNG图片怎么动态生成HTML??在线等..谢谢!!
- CImage如何加载存放在内存中的位图信息
- 动态创建静态文本框
- 散分,2分钟解贴
- 请问.我使用ODBC写数据库的题出了点错误.可否帮帮忙指教一下!!!!!!!
- 请高手赐教: 类型转换有什么作用?如 HWND* 和 CMainFram *的转换
- 怎么控制Combo box的弹出方向(一般向下,怎么使它向上?)
- WIN98下作的软件想升级到WIN2000该怎么办啊??(很急、很急!~)
- 简单的键盘消息!
- Finding memory leaks ---当程序编译时,为什么在 Debuger 看不到 内存泄漏 的判断,而是 no error!
- 请问如何在一个有控件的对话框内自己绘图?有什么OwnerDraw的控件好用?
- 请问大家 有没写过扫描器
或
MessageBeep(MB_OK);
然后设置shift caps lock 和ctrl键的声音
以后你想什么时候嘟
就按一下
打开和关闭的声音不一样哦
呵呵
开玩笑
都叫他们说了
还有,我已经安装了msdn 的vc 部分。 为什么查找时,没有详细说明?只得下面的东西, 都不知道怎样用? 始终都是不会用
Beep
The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes. BOOL Beep(
DWORD dwFreq, // sound frequency, in hertz
DWORD dwDuration // sound duration, in milliseconds
);
Parameters
dwFreq
Windows NT: Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
dwDuration
Windows NT: Specifies the duration, in milliseconds, of the sound.
Return Values
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. Res
Windows 95: The Beep function ignores the dwFreq and dwDuration parameters. On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep.QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.See Also
Errors Overview, Error Functions, MessageBeep
一样的错误
系统根本不知道Beep 为何物
你这个程序包含了stdafx.h了吗,至少应该有winbase.h
包含这个就一切正常。
UINT uType // sound type
);
Parameters
uType
Specifies the sound type, as identified by an entry in the [sounds] section of the registry. This parameter can be one of the following values: Value Sound
0xFFFFFFFF Standard beep using the computer speaker
MB_ICONASTERISK SystemAsterisk
MB_ICONEXCLAMATION SystemExclamation
MB_ICONHAND SystemHand
MB_ICONQUESTION SystemQuestion
MB_OK SystemDefault
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Import Library: Use kernel32.lib.这不是写着吗?还有你写的是什么类型的应用程序,这个头文件一般是不用包含的。
再不行就
#include <winbase.h>
#include <windows.h>
非基于MFC的控制台程序要包含
DWORD dwFreq, // sound frequency
DWORD dwDuration // sound duration
);
Header: Declared in Winbase.h; include Windows.h