用Beep函数【VB声明】 Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long【说明】 用于生成简单的声音 【返回值】 Long,TRUE(非零)表示成功,否则返回零。会设置GetLastError 【备注】 在windows95中,这个函数简单的播放默认系统响铃【参数表】 dwFreq --------- Long,声音频率(从37Hz到32767Hz)。在windows95中忽略 dwDuration ----- Long,声音的持续时间,以毫秒为单位。如为-1,表示一直播放声音,直到再次调用该函数为止。在windows95中会被忽略
API各种编程工具都可用,Beep函数----可能是最简单的API了
API各种编程工具都可用,Beep函数----可能是最简单的API了
Module Module1 Private Declare Function MessageBeep Lib "user32" Alias "MessageBeep" (ByVal wType As Integer) As Integer Sub Main() MessageBeep(0) End SubEnd Module
Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long【说明】
用于生成简单的声音 【返回值】
Long,TRUE(非零)表示成功,否则返回零。会设置GetLastError 【备注】
在windows95中,这个函数简单的播放默认系统响铃【参数表】
dwFreq --------- Long,声音频率(从37Hz到32767Hz)。在windows95中忽略 dwDuration ----- Long,声音的持续时间,以毫秒为单位。如为-1,表示一直播放声音,直到再次调用该函数为止。在windows95中会被忽略
Module Module1
Private Declare Function MessageBeep Lib "user32" Alias "MessageBeep" (ByVal wType As Integer) As Integer
Sub Main()
MessageBeep(0)
End SubEnd Module
Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As integer, ByVal dwDuration As integer) As integer方法2:
用锤子砸