Arreter un son

jetest Messages postés 18 Date d'inscription lundi 26 mai 2003 Statut Membre Dernière intervention 8 septembre 2004 - 14 juin 2003 à 01:32
ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 - 14 juin 2003 à 10:55
soir à tous

alors la je pige pas, bcp de source et pas bcp de vrai exemple sur l'arret d'un son !?

j'ai ca:
monwav = Dir1.Path & "" & File1.FileName
jouewav = Shell("sndrec32 /play " & monwav, vbHide)
choixson = (monwav)


comment je l'arrete mon son ?

si vous avez autre chose ba merci

1 réponse

ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 26
14 juin 2003 à 10:55
salut

shell te renvoie un ID dans jouewav :

Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long

Private Sub KillProgram(ProcessId As Long)
Dim ProcessHandle As Long
Const PROCESS_TERMINATE = 1

ProcessHandle = OpenProcess(PROCESS_TERMINATE, False, ProcessId)
TerminateProcess ProcessHandle, 4
End Sub

Private Sub Form_Load()
Dim jouewav As Long, monwav As String
monwav = Dir1.Path & "" & File1.FileName
jouewav = Shell("sndrec32 /play " & monwav, vbHide)
KillProgram jouewav
End Sub

voila

ShareVB
0
Rejoignez-nous