Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Can I pick the size and position of an avi file?

Ivan, all I can say it THANKS... perfect...

seeya ste
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pictures and Text Boxes print in wrong position and size in 2007 Uttersmd Excel Discussion (Misc queries) 0 October 21st 09 06:57 PM
Fix size and position of comment viettuyen Excel Discussion (Misc queries) 1 April 29th 09 12:41 PM
File Size With Macros Has Increased From Its Origina Size Fred Excel Discussion (Misc queries) 1 April 26th 08 12:24 AM
Window Position & Size [email protected] Excel Discussion (Misc queries) 4 May 18th 05 05:21 PM
Auto-Size and Position Pictures with a Macro ? blewyn Excel Programming 8 February 9th 04 05:29 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"