Code:
Private pMC As FilgraphManager
Private pVW As IVideoWindow
Private Sub Form_Load()
'Reference quartz.dll#ActiveMovie control type library
Me.ScaleMode = 3
Picture1.ScaleMode = 3
End Sub
Private Sub Command1_Click()
ActiveMovie_ShowGif App.Path & "\001.gif"
End Sub
Private Sub Command2_Click()
StopClear
End Sub
Sub ActiveMovie_ShowGif(GifFile As String)
On Error Resume Next
Set pMC = New FilgraphManager
pMC.Stop
pMC.RenderFile ""
On Error GoTo Lhandle
pMC.RenderFile GifFile
On Error Resume Next
Set pVW = pMC
pVW.WindowStyle = CLng(&H6000000)
pVW.Left = 0: pVW.Top = 0
Picture1.Width = pVW.Width
Picture1.Height = pVW.Width
'pVW.Width = Picture1.ScaleWidth
'pVW.Height = Picture1.ScaleHeight
pVW.Owner = Picture1.hWnd
pVW.MessageDrain = Picture1.hWnd
pMC.Run
Exit Sub
Lhandle:
MsgBox ("err")
End Sub
Sub StopClear()
pMC.Stop
Set pVW = Nothing
Set pMC = Nothing
End Sub