VB4/16 BIT/hWndDisplay/AVI

I am using the hWndDisplay property of a multimedia control to display AVIs in a picture box.  The AVI to be displayed is selected by the user from a list.  I would like to automatically adjust the size of the picture box to fit the AVI, but I don't know what aspect/property of the AVI to address.  Is there a way to do this?  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have you tried to change the PictureBox to AutoSize?
Send mci command to the Avi to resize to coordinates you will give it (in pixels).
I've also paste how do I place the Avi on a windows since  don't know how you did it. (You would be nice to tell me.)
Here is the code:

Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As Long, ByRef dwParam2 As Any) As Long
    Public Const MCI_WINDOW = &H841
        Public Const MCI_OVLY_WINDOW_ENABLE_STRETCH = &H100000
        Public Const MCI_OVLY_WINDOW_HWND = &H10000
            dwCallback As Long
            hwnd As Long
            nCmdShow As Long
            lpstrText As String
        End Type
    Public Const MCI_PUT = &H842
        Public Const MCI_OVLY_PUT_DESTINATION = &H40000
        Public Const MCI_OVLY_RECT = &H10000
            dwCallback As Long
            rc As RECT
        End Type

Dim API As Integer
        'Put in Window
            AviWindows.hwnd = frmMain.hwnd
            AviWindows.dwCallback = frmMain.hwnd
            API = mciSendCommand(frmMain.MMCtrl.DeviceID, MCI_WINDOW, MCI_OVLY_WINDOW_ENABLE_STRETCH + MCI_OVLY_WINDOW_HWND, AviWindows)
        'Scale to full Windows
            AviPutRect.rc.Bottom = frmMain.ScaleHeight
            AviPutRect.rc.Top = 0
            AviPutRect.rc.Left = 0
            AviPutRect.rc.Right = frmMain.ScaleWidth
            AviPutRect.dwCallback = frmMain.hwnd
            API = mciSendCommand(frmMain.MMCtrl.DeviceID, MCI_PUT, MCI_OVLY_PUT_DESTINATION + MCI_OVLY_RECT, AviPutRect)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
STKeithAuthor Commented:
I placed the AVI into the picture box with the following code:
MMControl1.hWndDisplay = Picture1.hWnd
MMControl1.command = "open"
MMControl1.command = "play"

P.S.  I tried setting the picture box autosize property to True, but apparantly that only works for graphics and not AVIs.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.