Lancer un fichier son dans un evenement vb

cs_sergep Messages postés 1 Date d'inscription dimanche 19 octobre 2003 Statut Membre Dernière intervention 29 janvier 2005 - 29 janv. 2005 à 19:32
cs_Pingouin Messages postés 262 Date d'inscription lundi 26 août 2002 Statut Membre Dernière intervention 24 août 2005 - 29 janv. 2005 à 20:29
bonjour
j'aimerai pouvoir lancer des fichiers son (.wav)personalisés dans un evenement vb.
quelconque.Idéalement ces fichiers se trouveraient dans un dossier.
Merci de m'aider
Serge

1 réponse

cs_Pingouin Messages postés 262 Date d'inscription lundi 26 août 2002 Statut Membre Dernière intervention 24 août 2005
29 janv. 2005 à 20:29
Private Declare Function sndPlaySound Lib "winmm.dll" Alias
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
As Long

' Joue le fichier de manière synchrone (attend la fin de la lecture pour rendre la main).

Private Const SND_SYNC = &H0

' Joue le fichier de manière asynchrone (rend la main immédiatement).

Private Const SND_ASYNC = &H1

' N'attend pas si le driver son est occupé.

Private Const SND_NOWAIT = &H2000

Private Sub JouerFichierWav(stFichier As String)

' Joue le fichier son envoyé en paramêtre si le driver est disponible.

Call sndPlaySound("C:\WINDOWS\MEDIA\LOGOFF.WAV", SND_ASYNC Or SND_NOWAIT)

End Sub



Private Sub Form_Click()

JouerFichierWav (stFichier)

End Sub




Voila a mon avis ca doit repondre a ta demande...



@+


The Pingouin
0
Rejoignez-nous