- Option Explicit
-
- Dim ret As Long, mp3file As String
- Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
-
- Private Sub Form_Load()
- mp3file = "c:\xxx.mp3"
- ret = mciSendString("OPEN " & mp3file & " Alias Sonido", 0, 0, 0) 'ouvre
- ret = mciSendString("Play sonido", 0, 0, 0) 'Joue
- End Sub
-
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- ret = mciSendString("Stop sonido", 0, 0, 0) 'Pause (si on fait lecture ca reprendra la)
- ret = mciSendString("Close sonido", 0, 0, 0) 'Arret (si on fait lecture ca recommence au debut)
- End Sub
-
Option Explicit
Dim ret As Long, mp3file As String
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub Form_Load()
mp3file = "c:\xxx.mp3"
ret = mciSendString("OPEN " & mp3file & " Alias Sonido", 0, 0, 0) 'ouvre
ret = mciSendString("Play sonido", 0, 0, 0) 'Joue
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
ret = mciSendString("Stop sonido", 0, 0, 0) 'Pause (si on fait lecture ca reprendra la)
ret = mciSendString("Close sonido", 0, 0, 0) 'Arret (si on fait lecture ca recommence au debut)
End Sub