PDA

Click to See Complete Forum and Search --> : movies


mcgoo
Mar 1st, 2001, 11:56 PM
I'm trying to, on form load, have an avi play automatically. How do I do this????

HCK
Mar 2nd, 2001, 03:44 AM
Option Explicit
Dim last$, todo$, x%

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

Private Sub Form_Load()

last$ = Form1.hWnd & " Style " & &H40000000

todo$ = "open c:\myvideo.avi Type avivideo Alias video parent " & last$

x% = mciSendString(todo$, 0&, 0, 0)

x% = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)

x% = mciSendString("play video wait", 0&, 0, 0)

x% = mciSendString("close video", 0&, 0, 0)

End Sub

Private Sub Form_Unload(Cancel As Integer)

x% = mciSendString("close video", 0&, 0, 0)

End Sub

Mar 2nd, 2001, 11:39 AM
Or you could make it really simple, and add a Windows
Media Player control, and a Common Dialog, and there
ya go.