Link to home
Start Free TrialLog in
Avatar of rmvprasad
rmvprasad

asked on

Media player

If I click on an button a muisc should be heard using a media player , real one or any thing else. I want the code for this.
Avatar of vinnyd79
vinnyd79

This will play a wav file:

' declarations
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

' usage
Private Sub Command1_Click()
sndPlaySound "c:\Somefile.wav", 1
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Da_Weasel
Da_Weasel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial