PlayAviNoMCI




Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long

Dim AviName
Private Sub Command1_Click()
AviName = "c:\shut.avi"
ComStr = "open c:\shut.avi Type avivideo Alias video"
'ComStr = "play video" 'Popup window (default)

'ComStr = "play video fullscreen" 'Do this for full screen

'ComStr = "play video from 0 to 10" 'Plays first 10 frames

'ComStr = "play video from 11 to 20" 'plays frames in the middle

'ComStr = "play video from 0 to wait" 'plays from beginning

'ComStr = "pause video" 'Pause your video during play

'ComStr = "resume video" 'Resumes (continues) paused video

'ComStr = "stop video" 'stops your video during play

'ComStr = "close video" 'Closes the file

'Important not to forget this!!

'TIP: When AVI is finished, you must close it. You cannot

'play it again until it is closed unless you specifiy a starting

'point at the "play" command.

RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command2_Click()
ComStr = "stop video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command3_Click()
ComStr = "play video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command4_Click()
ComStr = "pause video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command5_Click()
ComStr = "resume video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command6_Click()
ComStr = "close video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Form_Load()
Command1.Caption = "&Open"
Command2.Caption = "&Stop"
Command3.Caption = "&Play"
Command4.Caption = "P&ause"
Command5.Caption = "&Resume"
Command6.Caption = "&Close"
End Sub

Private Sub Form_Unload(Cancel As Integer)
ComStr = "close video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long

Dim AviName
Private Sub Command1_Click()
AviName = "c:\shut.avi"
ComStr = "open c:\shut.avi Type avivideo Alias video"
'ComStr = "play video" 'Popup window (default)

'ComStr = "play video fullscreen" 'Do this for full screen

'ComStr = "play video from 0 to 10" 'Plays first 10 frames

'ComStr = "play video from 11 to 20" 'plays frames in the middle

'ComStr = "play video from 0 to wait" 'plays from beginning

'ComStr = "pause video" 'Pause your video during play

'ComStr = "resume video" 'Resumes (continues) paused video

'ComStr = "stop video" 'stops your video during play

'ComStr = "close video" 'Closes the file

'Important not to forget this!!

'TIP: When AVI is finished, you must close it. You cannot

'play it again until it is closed unless you specifiy a starting

'point at the "play" command.

RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command2_Click()
ComStr = "stop video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command3_Click()
ComStr = "play video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command4_Click()
ComStr = "pause video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command5_Click()
ComStr = "resume video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Command6_Click()
ComStr = "close video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub

Private Sub Form_Load()
Command1.Caption = "&Open"
Command2.Caption = "&Stop"
Command3.Caption = "&Play"
Command4.Caption = "P&ause"
Command5.Caption = "&Resume"
Command6.Caption = "&Close"
End Sub

Private Sub Form_Unload(Cancel As Integer)
ComStr = "close video"
RV = mciSendString(ComStr, 0&, 0, 0&)
End Sub











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