码迷,mamicode.com
首页 > 其他好文 > 详细

VB播放声音

时间:2017-05-31 12:10:09      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:orm   blog   play   next   ror   .dll   ring   引用   app   

公共Modules定义:

Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Function EffectSound(Effect As String) As Long
    On Error Resume Next
    Dim sEffect As String
    sEffect = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\") & Effect
    PlaySound sEffect, 0, 0
End Function

Forms中引用:

Call EffectSound("OO.wav")

 

VB播放声音

标签:orm   blog   play   next   ror   .dll   ring   引用   app   

原文地址:http://www.cnblogs.com/blossomwei/p/6922949.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!