ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I pick the size and position of an avi file? (https://www.excelbanter.com/excel-programming/298035-can-i-pick-size-position-avi-file.html)

ste mac

Can I pick the size and position of an avi file?
 
Hi Guys, the code below was kindly posted by Michel Pierron...

It works fine, but I really wanted it to run in it own window
so the spreadsheet can be seen behind the avi...How do I adjust
the code to do this? can I pick the avi window size/position?

Thanks for any help....
ste

Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" (ByVal lpstrCommand As String _
, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long _
, ByVal hwndCallback As Long) As Long

Sub FullScreenAvi()
Const aviFile = "C:\Clock.avi" ' Modify as appropriate
Dim Cmd As String
Cmd = "play " & aviFile & " fullscreen "
mciSendString Cmd, 0&, 0, 0&
End Sub

Ivan F Moala[_3_]

Can I pick the size and position of an avi file?
 
something like;

Declare Function mciSendString _
Lib "winmm" _
Alias "mciSendStringA" ( _
ByVal lpstrCommand As String, _
ByVal lpstrReturnStr As Any, _
ByVal wReturnLen As Long, _
ByVal hCallBack As Long) _
As Long

Declare Function GetActiveWindow Lib "USER32" () As Integer

Const WS_CHILD = &H40000000

Sub PlayAVIFile()
Dim CmdStr As String, FileSpec As String
Dim Ret As Long, XlShwnd As Long

'The name and location of the AVI file to play.
FileSpec = "C:\AVI\Files\E-Mail\Scanemail.avi"

'Get the active sheet's window handle.
XlShwnd = GetActiveWindow()

'Opens the AVIVideo and creates a child window on the sheet
'where the video will display. "Animation" is the device_id.
CmdStr = ("open " & FileSpec & " type AVIVideo alias animation parent " & _
LTrim(Str(XlShwnd)) & " style " & LTrim(Str(WS_CHILD)))

Ret = mciSendString(CmdStr, 0&, 0, 0)

'Put the AVI window at location 50, 50 relative to the
'parent window (Microsoft Excel) with a size of 260 x 160.
Ret = mciSendString("put animation window at 50 50 260 160", 0&, 0, 0)

'The wait tells the MCI command to complete before returning
'control to the application.
Ret = mciSendString("play animation wait", 0&, 0, 0)

'Close windows.
Ret = mciSendString("close animation", 0&, 0, 0)


End Sub


(ste mac) wrote in message . com...
Hi Guys, the code below was kindly posted by Michel Pierron...

It works fine, but I really wanted it to run in it own window
so the spreadsheet can be seen behind the avi...How do I adjust
the code to do this? can I pick the avi window size/position?

Thanks for any help....
ste

Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" (ByVal lpstrCommand As String _
, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long _
, ByVal hwndCallback As Long) As Long

Sub FullScreenAvi()
Const aviFile = "C:\Clock.avi" ' Modify as appropriate
Dim Cmd As String
Cmd = "play " & aviFile & " fullscreen "
mciSendString Cmd, 0&, 0, 0&
End Sub


ste mac

Can I pick the size and position of an avi file?
 
Ivan, all I can say it THANKS... perfect...

seeya ste


All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com