请登录[¤ 阳光论坛 ¤]参与讨论


阳光宝宝
90

 □ 主题: 用API实现软件的背景音乐功能
 □ 内容: 1楼

      ''''声明 
      Private Declare Function mciSendString Lib "winmm.dll" Alias _ 
      "mciSendStringA" (ByVal lpstrCommand As String, ByVal _ 
      lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _ 
      hwndCallback As Long) As Long 
      Dim i As Integer 
       
      Private Sub playsound(FileName As String) 
      Dim ret As Integer 
      ret = mciSendString("close MyWav", 0&, 0, 0) 
      Select Case UCase(Right(FileName, 3)) 
      Case "WAV" 
      ret = mciSendString("open " & FileName & " type WAVEAudio alias MyWav", 0&, 0, 0) 
      Case "MID" 
      ret = mciSendString("open " & FileName & " type Sequencer alias MyWav", 0&, 0, 0) 
      Case "AVI" 
      ret = mciSendString("open " & filename & " type AVIvideo alias MyWav", 0&, 0, 0) 
      Case "CDA" 
      ret = mciSendString("open " & filename & " type CDaudio alias MyWav", 0&, 0, 0) 
      Case Else 
      ret = mciSendString("open " & FileName & " alias MyWav", 0&, 0, 0) 
      End Select 
      ret = mciSendString("play MyWav", 0&, 0, 0) 
      End Sub 
       
      Private Sub Timer3_Timer() 
      Dim s As String 
      s = String(256, Chr(0)) 
      Call mciSendString("status MyWav mode", s, Len(s), 0) 
      If InStr(1, s, "stop", vbTextCompare) Then 
      playsound filename 
      End If 
      End Sub 
       
      调用:playsound music.mid 
       
      
——
      
争分夺秒背单词 → western  a.西方的,西部的
 □ 发帖时间:2004-2-29|18:23:03 |回复|返回|

 页次:1/1页 每页10  本主题贴数0 分页: 1


你还没有登录论坛,所以不能发表你的意见。你可以选择:

1、我已注册,我要

2、我还没注册,我要

3、太麻烦了,我还是

Go Top

Copyright by(C)2003-2015 http://abc.sy578.cn