|
-
Feb 20th, 2001, 01:14 PM
#1
Thread Starter
Banned
I have to code to play a AVI useing API. But how do I move the movie into a picture box? I know it has something to do with the hwnd.
-
Feb 22nd, 2001, 01:00 PM
#2
Member
AVI Player
You have to place a MultiMediaControl in your Form.
It is the Microsoft Multimedia Control 6.0 which is within Projects|Komponents, add it to your Project.
Set the DeviceType Property of the MMControl to AVIVideo.
Select the Filename Property set them to the file you wanna play with the Player.
Sub Form_Load:
NameOfTheMultiMediaControl.Command = "Open"
NameOfTheMultiMediaControl.hWndDisplay = NameOFThePictureBox.hWnd
End Sub
Thats the way without any API Funktion.
-
Feb 22nd, 2001, 03:23 PM
#3
Thread Starter
Banned
Thx but,
Im doing this useing API, not the MMControl. So how would you do it threw API?
-
Feb 23rd, 2001, 04:10 PM
#4
New Member
i've seen this before. post your code to play the avi and i'll see if i can't remember how it's done.
-
Feb 23rd, 2001, 04:54 PM
#5
New Member
here ya go i thought i still had this in amodule somewhere just had to find it
Private 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
Public Sub PlayVideo(FilePath As String, PlayIn As Object)
FilePath = UCase(FilePath)
If Right(FilePath, 3) = "AVI" Then
mciSendString "open " & FilePath & " type AVIvideo alias movie style child parent " & PlayIn.hWnd, 0&, 0, 0
Else
mciSendString "open " & FilePath & " type MPEGvideo alias movie style child parent " & PlayIn.hWnd, 0&, 0, 0
End If
mciSendString "play movie wait", 0, 0, 0
mciSendString "close movie", 0, 0, 0
End Sub
just put this in a module and it will play avi or mpeg videos wherever you want them in a form or picturebox anything with a hwnd
just call it by using the path to the file you want to play and the object you want it played in
Call PlayVideo("c:\mydocuments\sample.avi",form1)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|