怎样在vb中加背景音乐

2024-12-25 07:15:54
推荐回答(1个)
回答1:

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

lpszname 就是要播放的声音文件:wav
hmodule =0

dwflags 为下面:
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_ASYNC = &H1 ' 同步play asynchronously
Private Const SND_SYNC = &H0 ' 异步play synchronously (default)