50分!用VB做一个小程序
来源:百度知道 编辑:UC知道 时间:2024/05/05 09:05:03
把声音文件换成你的
'============================================================
'播放Wav声音文件
'module (Api Functions declarations)
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Public Const SND_ASYNC = &H1 ' play asynchronously
Public Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Public Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Public Const SND_SYNC = &H0 ' play synchronously (default)
'Form code
public sub form_load()
dim ret as long
ret=sndplaysound("c:\windows\bee.wav",SND_SYNC)
End Sub
'========================================================
ding
'//给你一个例子
'//周杰伦的回到过去
'//直接运行代码就行
Private Declare Func