请问在vc中怎样使系统发出一声“嘟”?
尽量用简单的方法, 若有解释就谢天谢地了

解决方案 »

  1.   

    还可以用PlaySound(),如果指定的文件找不到也会嘟一下。
      

  2.   

    Beep(500, 500);

    MessageBeep(MB_OK);
      

  3.   

    按住shift键八秒钟
    然后设置shift  caps lock 和ctrl键的声音
    以后你想什么时候嘟
    就按一下
    打开和关闭的声音不一样哦
    呵呵
    开玩笑
    都叫他们说了
      

  4.   

    首先多谢大家,不过,我快让你们气死了, 这么多人回答了, 为什么没有一个人说它包含在哪个头文件?
    还有,我已经安装了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  
      

  5.   

    beep : undeclare identifier
      

  6.   

    not "beep " but "Beep"
      

  7.   

    Beep  :  undeclare  identifier 
    一样的错误
    系统根本不知道Beep 为何物
      

  8.   

    If meet the comment "error C2065: 'Beep' : undeclared identifier",you should try to add "#include <windows.h>" in your file.
      

  9.   

    我不知道你出了什么问题,我这里用Beep就很好,没有任何错误
    你这个程序包含了stdafx.h了吗,至少应该有winbase.h
      

  10.   

    #include "stdafx.h"
    包含这个就一切正常。
      

  11.   

    BOOL MessageBeep(
      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.
      

  12.   

    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.这不是写着吗?还有你写的是什么类型的应用程序,这个头文件一般是不用包含的。
    再不行就
    #include <winbase.h>
    #include <windows.h>
    非基于MFC的控制台程序要包含
      

  13.   

    BOOL Beep(
      DWORD dwFreq,      // sound frequency
      DWORD dwDuration   // sound duration
    );
    Header: Declared in Winbase.h; include Windows.h