guys did you know that you can play video files in VB too. this was told to me by a good friend of mine
video in VB
Started by sigs, Apr 30 2006 12:05 PM
4 replies to this topic
#1
Posted 30 April 2006 - 12:05 PM
|
|
|
#2
Guest_Jordan_*
Posted 30 April 2006 - 05:24 PM
Guest_Jordan_*
What kind of video? AVI and MPEGs or Flash?
VB .NET 1.0, 2.0 or VB 6.0?
VB .NET 1.0, 2.0 or VB 6.0?
#3
Posted 02 May 2006 - 02:49 AM
those are AVI files
#4
Posted 02 May 2006 - 02:50 AM
'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Add 2 CommandButtons to your form (named Command1 and Command2).
'When you press the first button the AVI movie will start to play.
'Even after the AVI Finish playing, it is still takes memory.
'To remove it from the memory press the second button.
'Insert this code to the module :
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
'Insert the following code to your form:
Private Sub Command1_Click()
Dim returnstring As String
Dim FileName As String
returnstring = Space(127)
'Replace d:\my box\MyMovie.avi with the AVI file you want to play
FileName = "d:\my box\MyMovie.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
Private Sub Command2_Click()
erg = mciSendString("close video", returnstring, 127, 0)
'Add 2 CommandButtons to your form (named Command1 and Command2).
'When you press the first button the AVI movie will start to play.
'Even after the AVI Finish playing, it is still takes memory.
'To remove it from the memory press the second button.
'Insert this code to the module :
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
'Insert the following code to your form:
Private Sub Command1_Click()
Dim returnstring As String
Dim FileName As String
returnstring = Space(127)
'Replace d:\my box\MyMovie.avi with the AVI file you want to play
FileName = "d:\my box\MyMovie.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
Private Sub Command2_Click()
erg = mciSendString("close video", returnstring, 127, 0)
#5
Posted 12 May 2006 - 01:52 AM
hey thats a new news to me also i will try it out


Sign In
Create Account


Back to top









