Page 1 sur 1

Jouer un son

MessagePublié: 05 Nov 2007 à 17:50
par Michael DELIQUE
Code : Tout sélectionner
Public Function PlaySound_API(wPathFile As String)As Long
   
%REM
'Variable API pur la fonction PlaySound_API
Declare Public Function MakeSound Lib "winmm.dll" Alias "sndPlaySoundA" (Byval lpszSoundName As String, Byval uFlags As Long) As Long
%END REM
   
   
   On Error Goto ErreurPlaySound_API
   
   PlaySound_API = MakeSound(wPathFile,1)
   
   Exit Function
ErreurPlaySound_API:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   PlaySound_API = 0
   Exit Function
End Function