50分!用VB做一个小程序

来源:百度知道 编辑:UC知道 时间:2024/05/05 09:05:03
我想用VB做一个恐怖的程序,程序内容需要:有声音,然后有图片,图片怎么弄我懂,但我不知道怎么弄它一打开程序就自动播放声音,高手帮帮我啊!!!!!

把声音文件换成你的

'============================================================
'播放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