S
Sabine
System background: Office 2003 / Powerpoint 2003
VBA coding
video file: avi
Hello,
currently I am trying to get a video output in a window or object within a
presentation of my choice.
I am controlling the MCI via VBA and WinAPI.
It only opens a new window, but I cannot get it to re-direct the output of
the video into a window I specify.
I am now sure how to handle this - I try to use "hwnd" but I don't get it to
work.
Can you please give me a hint / advise?
Many Thanx in advance!
Here's the code I'm currently using:
Private Sub OpenVideoDevice()
Dim lngRet As Long
Dim mop As MCI_OPEN_PARMS
Dim mow As MCI_OVLY_WINDOW_PARMS
Dim lngFlags As Long
Dim hwnd As Long
'Setze den Geraetetypen: Videoplayer
mop.strDeviceType = "avivideo"
'Oeffnen des Videoplayers
lngRet = mciSendCommand(0&, MCI_OPEN, MCI_OPEN_TYPE, mop)
lngFlags = MCI_OVLY_WINDOW_HWND
hwnd = GetActiveWindow
' Set the window handle
mow.hwnd = hwnd
Debug.Print hwnd
' Issue the MCI_WINDOW command
lngRet = mciSendCommand(0&, MCI_WINDOW, lngFlags, mow)
Call PlayVideo("e:\Legofilm.avi") 'Uebergabe des Videofiles
End Sub
Sub PlayVideo(strFile As String)
Dim strCommand As String
Dim strRet As String
Dim lngBytes As Long
Dim lngRet As Long
'Oeffnen des Videofiles
strCommand = "open " & strFile & " alias vid"
strRet = Space(255) '255 Leerzeichen
lngRet = mciSendString(strCommand, strRet, lngBytes, 0&)
'Bei Erfolg abspielen
If lngRet = 0 Then
strCommand = "play vid"
strRet = Space(255)
lngRet = mciSendString(strCommand, strRet, lngBytes, 0&)
End If
End Sub
VBA coding
video file: avi
Hello,
currently I am trying to get a video output in a window or object within a
presentation of my choice.
I am controlling the MCI via VBA and WinAPI.
It only opens a new window, but I cannot get it to re-direct the output of
the video into a window I specify.
I am now sure how to handle this - I try to use "hwnd" but I don't get it to
work.
Can you please give me a hint / advise?
Many Thanx in advance!
Here's the code I'm currently using:
Private Sub OpenVideoDevice()
Dim lngRet As Long
Dim mop As MCI_OPEN_PARMS
Dim mow As MCI_OVLY_WINDOW_PARMS
Dim lngFlags As Long
Dim hwnd As Long
'Setze den Geraetetypen: Videoplayer
mop.strDeviceType = "avivideo"
'Oeffnen des Videoplayers
lngRet = mciSendCommand(0&, MCI_OPEN, MCI_OPEN_TYPE, mop)
lngFlags = MCI_OVLY_WINDOW_HWND
hwnd = GetActiveWindow
' Set the window handle
mow.hwnd = hwnd
Debug.Print hwnd
' Issue the MCI_WINDOW command
lngRet = mciSendCommand(0&, MCI_WINDOW, lngFlags, mow)
Call PlayVideo("e:\Legofilm.avi") 'Uebergabe des Videofiles
End Sub
Sub PlayVideo(strFile As String)
Dim strCommand As String
Dim strRet As String
Dim lngBytes As Long
Dim lngRet As Long
'Oeffnen des Videofiles
strCommand = "open " & strFile & " alias vid"
strRet = Space(255) '255 Leerzeichen
lngRet = mciSendString(strCommand, strRet, lngBytes, 0&)
'Bei Erfolg abspielen
If lngRet = 0 Then
strCommand = "play vid"
strRet = Space(255)
lngRet = mciSendString(strCommand, strRet, lngBytes, 0&)
End If
End Sub