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
