发表于:2006-04-24 16:19:00
12楼
我们以前有人用过,不过我还没有自己用过!
1. Enter the Visual Basic Editor. 2. Select the Project_User in the project explorer.3. Right click.4. Select Insert \ Module5. Cut and paste the following Code:Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long6. Then you can either use the following kind of Subroutine in the same module to set up individual functions to play predefined sounds:Sub PlayWav()Dim NN = sndPlaySound("C:\SOMEWAV.WAV", 0)End SubOR7. Insert a pushbutton and right click.8. Select Edit Script.9. Paste the following code between the Private Sub and End Sub statements:sndPlaySound "C:\WINNT\MEDIA\tada.wav", 0 'This path can be the path to any .wav file on the machine.