albundy
asked on
how to know the size of a video ?
hello,
I open a video with mediaplayer control in vb6.
I would like to know the real size of the video, is there anyway to do it ?
regards,
oliver
I open a video with mediaplayer control in vb6.
I would like to know the real size of the video, is there anyway to do it ?
regards,
oliver
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Albundy,
Could you close out the question anyway please?
It helps with the clean up process.
Also, Could you post your answer as a comment so that If someone else has the same problem they can find the answer quickly?
Thanks
Ed.
Could you close out the question anyway please?
It helps with the clean up process.
Also, Could you post your answer as a comment so that If someone else has the same problem they can find the answer quickly?
Thanks
Ed.
ASKER
you're totally right :) I do it right now ;o)
put this in a module .bas
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type MCI_OVLY_RECT_PARMS
dwCallback As Long
rc As RECT
End Type
Global Const MCI_OVLY_WHERE_SOURCE = &H20000
Global Const MCI_OVLY_WHERE_DESTINATION = &H40000
Global Const MCI_WHERE = &H843
'Enter the following Declare statement:
Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As Long, dwParam2 As Any) As Long
' Enter the following Declare statement:
Declare Function mciGetErrorString Lib "winmm.dll" _
Alias "mciGetErrorStringA" ( _
ByVal dwError As Long, _
ByVal lpstrBuffer As String, _
ByVal uLength As Long) As Long
-------------------------- ---------- ---------- ---------- --
then here is the code : note, you have to add a mci control , mci32.ocx.
Const MB_OK = 0
Const MB_ICONSTOP = 16
Dim Retval&, Buffer$
Dim dwParam2 As MCI_OVLY_RECT_PARMS
MMControl1.Command = "Close"
MMControl1.FileName = txt_pat 'Sample AVI file to be
'played.
MMControl1.Command = "Open"
'Initialize the structure being passed with mciSendCommand, and
'set it in case you want to use the Notify property:
dwParam2.dwCallback = MMControl1.hWnd
dwParam2.rc.Left = 0
dwParam2.rc.Top = 0
dwParam2.rc.Right = 0
dwParam2.rc.Bottom = 0
'Send the message:
'Enter the following two lines as one, single line of code:
Retval& = mciSendCommand(MMControl1. DeviceID, MCI_WHERE, MCI_OVLY_WHERE_SOURCE, dwParam2)
If Retval& <> 0 Then ' An error occurred.
Buffer$ = Space$(100)
'Get a description of the error:
Retval& = mciGetErrorString(Retval&, Buffer$, Len(Buffer$))
MsgBox Trim$(Buffer$), MB_OK + MB_ICONSTOP, "ERROR"
Else
'Resize the picture box:
wid = dwParam2.rc.Right - dwParam2.rc.Left
hei = dwParam2.rc.Bottom - dwParam2.rc.Top
size= wid & "x" & hei
'MMControl1.Command = "close"
End If
put this in a module .bas
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type MCI_OVLY_RECT_PARMS
dwCallback As Long
rc As RECT
End Type
Global Const MCI_OVLY_WHERE_SOURCE = &H20000
Global Const MCI_OVLY_WHERE_DESTINATION
Global Const MCI_WHERE = &H843
'Enter the following Declare statement:
Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As Long, dwParam2 As Any) As Long
' Enter the following Declare statement:
Declare Function mciGetErrorString Lib "winmm.dll" _
Alias "mciGetErrorStringA" ( _
ByVal dwError As Long, _
ByVal lpstrBuffer As String, _
ByVal uLength As Long) As Long
--------------------------
then here is the code : note, you have to add a mci control , mci32.ocx.
Const MB_OK = 0
Const MB_ICONSTOP = 16
Dim Retval&, Buffer$
Dim dwParam2 As MCI_OVLY_RECT_PARMS
MMControl1.Command = "Close"
MMControl1.FileName = txt_pat 'Sample AVI file to be
'played.
MMControl1.Command = "Open"
'Initialize the structure being passed with mciSendCommand, and
'set it in case you want to use the Notify property:
dwParam2.dwCallback = MMControl1.hWnd
dwParam2.rc.Left = 0
dwParam2.rc.Top = 0
dwParam2.rc.Right = 0
dwParam2.rc.Bottom = 0
'Send the message:
'Enter the following two lines as one, single line of code:
Retval& = mciSendCommand(MMControl1.
If Retval& <> 0 Then ' An error occurred.
Buffer$ = Space$(100)
'Get a description of the error:
Retval& = mciGetErrorString(Retval&,
MsgBox Trim$(Buffer$), MB_OK + MB_ICONSTOP, "ERROR"
Else
'Resize the picture box:
wid = dwParam2.rc.Right - dwParam2.rc.Left
hei = dwParam2.rc.Bottom - dwParam2.rc.Top
size= wid & "x" & hei
'MMControl1.Command = "close"
End If
ASKER
mmmmm how to close it ? :)
Albundy,
You could ask one of the EE Moderators to accept your comment as the answer. So if someone is looking for the same solution as yourself they can find it easily.
Cheers,
Ed.
You could ask one of the EE Moderators to accept your comment as the answer. So if someone is looking for the same solution as yourself they can find it easily.
Cheers,
Ed.
ASKER
boaaa, I give you the points... nevermind :o)
cheers,
cheers,
Cheers
ASKER
anyway I founded it on msdn.
thx anway