Greetings, all. I am trying to basically create a 'small' program in VB5 that will play an avi file when it is started. I have created a module (module1)
CODE:
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
O.k, I also created a form (form1), which's property visible is set to FALSE in the formload event (so no one knows that it exsists).
I then added this code to the form1.onload event:
CODE:
Private Sub Form_Load()
Form1.Visible = True
Dim sReturn As String * 128
Dim lPos As Long
Dim lStart As Long
Last$ = Form1.hWnd & " Style " & &H40000000
ToDo$ = "open G:\Users Personal Directory\Share All\FAXPROGRAM\FINDFILE.avi Type avivideo Alias video1 parent " & Last$
i = mciSendString(ToDo$, 0&, 0, 0)
i = mciSendString("Where video1 destination", ByVal sReturn, Len(sReturn) - 1, 0)
lStart = InStr(1, sReturn, " "
'pos of top
lPos = InStr(lStart + 1, sReturn, " "
'pos of left
lStart = InStr(lPos + 1, sReturn, " "
'pos width
lHeight = Mid(sReturn, lStart + 1)
i = mciSendString("put video1 window at 16 10 " & lWidth & " " & lHeight, 0&, 0, 0)
i = mciSendString("play video1 wait", 0&, 0, 0)
i = mciSendString("close video1", 0&, 0, 0)
O.k., once I start the program, I just get a form, no .avi or anything.....aggghhhh!
I just want the .avi to play all the way through, and once played once, it'll unload from memory and the program will close 'END'.
Anybody know??? Thanks!
Joe W. Guy
Network Admin
MIS Director
CODE:
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
O.k, I also created a form (form1), which's property visible is set to FALSE in the formload event (so no one knows that it exsists).
I then added this code to the form1.onload event:
CODE:
Private Sub Form_Load()
Form1.Visible = True
Dim sReturn As String * 128
Dim lPos As Long
Dim lStart As Long
Last$ = Form1.hWnd & " Style " & &H40000000
ToDo$ = "open G:\Users Personal Directory\Share All\FAXPROGRAM\FINDFILE.avi Type avivideo Alias video1 parent " & Last$
i = mciSendString(ToDo$, 0&, 0, 0)
i = mciSendString("Where video1 destination", ByVal sReturn, Len(sReturn) - 1, 0)
lStart = InStr(1, sReturn, " "
lPos = InStr(lStart + 1, sReturn, " "
lStart = InStr(lPos + 1, sReturn, " "
lHeight = Mid(sReturn, lStart + 1)
i = mciSendString("put video1 window at 16 10 " & lWidth & " " & lHeight, 0&, 0, 0)
i = mciSendString("play video1 wait", 0&, 0, 0)
i = mciSendString("close video1", 0&, 0, 0)
O.k., once I start the program, I just get a form, no .avi or anything.....aggghhhh!
I just want the .avi to play all the way through, and once played once, it'll unload from memory and the program will close 'END'.
Anybody know??? Thanks!
Joe W. Guy
Network Admin
MIS Director