PlayAVI (4)




'1. Inserisci un modulo con il seguente codice:

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

'2. Inserisci il seguente codice nel Form1:


Private Sub Form_Activate()
Dim returnstring As String
FileName As String
returnstring = Space(127)
'File AVI da suonare

FileName = "F:\Funstuff\Videos\Highperf\Welcome1.avi"
erg = mciSendString("open " & Chr$(34) & FileName & _
Chr$(34) & " type avivideo alias video", returnstring, 127, 0)
erg = mciSendString("set video time format ms", returnstring, 127, 0)
erg = mciSendString("play video from 0", returnstring, 127, 0)
End Sub

'It is important to close the video, even if the file to play has

'run out. To close the video, use the following line of code:

'erg = mciSendString("close video", returnstring, 127, 0)


'E' importante chiudere la linea, uguali file non possono essere

'avviati.











( playavi4.html )- by Paolo Puglisi - Modifica del 17/12/2023