Jouer un son

Jouer un son

Messagepar Michael DELIQUE » 05 Nov 2007 à 17:50

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
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers API