不用ActiveX控件也能播放声音文件
日期:2007年6月7日 作者: 相关tags: 不用 ActiveX 播放 声音 文件- [1] [2] 下一页
- 恢复exe文件打开方式,所有exe文件无法打开
- 用API函数遍历指定驱动器、目录的文件
- 135个治病小偏方,从此不用去医院
- 怎样删除计算机中的垃圾文件
- 几招解决局域网中共享文件无法访问
- 常见视频文件格式有哪些
- PE文件格式详解(5)
- 部件 MSINET.OCX 或其附件之一不能正确注册,一个文件丢失或无效
- 读取浏览器缓存文件(MozillaCacheView) v1.50 绿色汉化版
- 卡巴斯基2012KEY生成助手(卡巴2012授权文件生成器) 绿色版 V1.00
- Office2003跟Office2007文件兼容包
- PPS网络电视 ppstream播放器 v2.7.1335官方安装版
- 芒果tv官方下载 芒果TV播放器正式版 V2.0.11
- All Office Converter 文件格式转换器下载 免费中文版 V2011.7
- Stereoscopic Player(3D电影播放器下载) V1.74 中文无限制钻石版
- 360文件粉碎工具 1.6.0003beta
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
Option EXPlicit
Public Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
接下来把下面的代码粘贴到你想播放声音文件的地方,比如放在命令按钮的Click事件中
Dim sFlags As Long
sFlags = SND_ASYNC Or SND_NODEFAULT
sndPlaySound "FileName.Wav", sFlags
把上面的FileName.Wav换成你想要播放的声音文件的完整路径及文件名就行了。
如果你仅仅是想播放一些Windows常用的声音,比如说退出Windows的声音,有一种更简单的写法
sndPlaySound "SystemExit",sFlags
将SystemExit换成下面这些参数,试试是什么声音?
SystemStart
SystemExit
SystemDefault
SystemQuestion
SystemAsterisk
SystemExclamation
SystemHand
下面是sFlags所用参数的说明:
参数 说明
SND_SYNC Plays the WAV file specified and returns only when the sound has stopped playing
SND_ASYNC Plays the WAV file an continues after the sound has started playing.
SND_NODEFAULT Do not play the default sound if the if the WAV file is not found.
