Lancer un .mp3 avec wmplayer en VBS ?
Résolu/Fermé
Snowmann
Messages postés
227
Date d'inscription
samedi 14 octobre 2017
Statut
Membre
Dernière intervention
6 décembre 2020
-
Modifié le 12 févr. 2018 à 09:17
Snowmann Messages postés 227 Date d'inscription samedi 14 octobre 2017 Statut Membre Dernière intervention 6 décembre 2020 - 14 févr. 2018 à 20:25
Snowmann Messages postés 227 Date d'inscription samedi 14 octobre 2017 Statut Membre Dernière intervention 6 décembre 2020 - 14 févr. 2018 à 20:25
A voir également:
- Vba mp3
- Youtube mp3 - Guide
- Tubidy.com musique audio mp3 telecharger musique ✓ - Forum Audio
- Singe mp3 - Forum Musique / Radio / Clip
- Convertisseur mp3 pc - Télécharger - Conversion & Extraction
- Probléme avec Convertisseur youtube mp3 ✓ - Forum YouTube
2 réponses
cs_Le Pivert
Messages postés
7883
Date d'inscription
jeudi 13 septembre 2007
Statut
Contributeur
Dernière intervention
18 mars 2023
724
12 févr. 2018 à 11:30
12 févr. 2018 à 11:30
Bonjour,
Voilà ceci:
https://www.cjoint.com/c/HBmkDbRbKtQ
Voilà ceci:
https://www.cjoint.com/c/HBmkDbRbKtQ
Snowmann
Messages postés
227
Date d'inscription
samedi 14 octobre 2017
Statut
Membre
Dernière intervention
6 décembre 2020
2
14 févr. 2018 à 20:25
14 févr. 2018 à 20:25
Oui merci encore, je ne pense donc pas plus me plonger dans le vbs ^^ Mais c'est gentil de m'avoir répondu.
Bonne continuation et à peut-être bientôt,
Snowmann.
Bonne continuation et à peut-être bientôt,
Snowmann.
Modifié le 12 févr. 2018 à 18:04
12 févr. 2018 à 18:49
Voilà
12 févr. 2018 à 19:22
Modifié le 13 févr. 2018 à 09:00
Call AskQuestion() '***************************************************************************** Sub Play(URL) Dim Sound Set Sound = CreateObject("WMPlayer.OCX") Sound.URL = URL Sound.settings.volume = 100 Sound.Controls.play do while Sound.currentmedia.duration = 0 wscript.sleep 100 loop wscript.sleep (int(Sound.currentmedia.duration)+1)*1000 End Sub Sub AskQuestion() Dim Question,MsgFR MsgFR = "Voulez-vous ouvrir un fichier audio?" & vbcr & "Oui = Pour écouter" & vbcr & "Non = Pour arrêter" & vbcr & String(50,"*") Question = MsgBox(MsgFR,vbYesNO+vbQuestion+vbSystemModal,Title) If Question = VbYes Then Call Play ("C:\Users\LePivert\Music\Lecteur MP3\10-tu vuo fa l'americano.mp3")'jouer adapter le chemin End If If Question = VbYes Then MsgBox "Il y a une autre instance en cours d'exécution !" WScript.Quit() End If If Question = VbNo Then Call Kill("wscript.exe") End If If Question = VbNo Then Call Kill("wscript.exe") End If End Sub '***************************************************************************** 'Fonction pour ajouter les doubles quotes dans une variable Function DblQuote(Str) DblQuote = Chr(34) & Str & Chr(34) End Function '****************************************************************************** Function CommandLineLike(ProcessPath) ProcessPath = Replace(ProcessPath, "\", "\\") CommandLineLike = "'%" & ProcessPath & "%'" End Function '****************************************************************************** Sub Kill(MyProcess) Dim Titre,colItems,objItem,Processus,Question Titre = " Processus "& DblQuote(MyProcess) &" en cours d'exécution " Set colItems = GetObject("winmgmts:").ExecQuery("Select * from Win32_Process " _ & "Where Name like '%"& MyProcess &"%' AND commandline like " & CommandLineLike(WScript.ScriptFullName) & "",,48) For Each objItem in colItems objItem.Terminate(0)' Tuer ce processus Next End Sub '******************************************************************************13 févr. 2018 à 18:27
Et seule la msgbox fonctionne d'ailleurs...