AnimationCtrl/VB/AnimationCtrlmod.bas

Attribute VB_Name = "AnimationCtrlmod"
Option Explicit
'(c)2001 by Louis. Interface between VB program and VC AnimationCtrl code.
'
'This module was provided for educational purposes,
'feel free to include the code into you own projects.
'
'AnimationCtrl_Create
Private Declare Function AnimationCtrl_Create Lib "AnimationCtrl_Sample.dll" (ByVal X As LongByVal Y As LongByVal ParentWindowhWnd As Long) As Long
'AnimationCtrl_Open
Private Declare Function AnimationCtrl_Open Lib "AnimationCtrl_Sample.dll" (ByVal AVIFileName As String) As Long
'AnimationCtrl_Seek
Private Declare Function AnimationCtrl_Seek Lib "AnimationCtrl_Sample.dll" (ByVal FrameIndex As Integer) As Long
'AnimationCtrl_Play
Private Declare Function AnimationCtrl_Play Lib "AnimationCtrl_Sample.dll" (ByVal FrameStartIndex As IntegerByVal FrameEndIndex As IntegerByVal RepeatNumber As Integer) As Long
'AnimationCtrl_Stop
Private Declare Function AnimationCtrl_Stop Lib "AnimationCtrl_Sample.dll" () As Long
'AnimationCtrl_Destroy
Private Declare Function AnimationCtrl_Destroy Lib "AnimationCtrl_Sample.dll" () As Long
'AnimationCtrl_Move
Private Declare Sub AnimationCtrl_Move Lib "AnimationCtrl_Sample.dll" (ByVal X As LongByVal Y As Long)
'AnimationCtrl_Show
Private Declare Sub AnimationCtrl_Show Lib "AnimationCtrl_Sample.dll" ()
'AnimationCtrl_Hide
Private Declare Sub AnimationCtrl_Hide Lib "AnimationCtrl_Sample.dll" ()

Public Function AnimationControl_Create(ByVal X As LongByVal Y As LongByRef ParentWindow As Object) As Boolean
    'on error resume next
    If AnimationCtrl_Create(X, Y, ParentWindow.hWnd) = 1 Then
        AnimationControl_Create = True
    Else
        AnimationControl_Create = False
    End If
End Function

Public Function AnimationControl_Open(ByVal AVIFileName As String) As Boolean
    'on error resume next
    If AnimationCtrl_Open(AVIFileName + Chr$(0)) = 1 Then
        AnimationControl_Open = True
    Else
        AnimationControl_Open = False
    End If
End Function

Public Function AnimationControl_Seek(ByVal FrameIndex As Long) As Boolean
    'on error resume next
    If AnimationCtrl_Seek(FrameIndex) = 1 Then
        AnimationControl_Seek = True
    Else
        AnimationControl_Seek = False
    End If
End Function

Public Function AnimationControl_Play(ByVal FrameStartIndex As LongByVal FrameEndIndex As LongByVal RepeatCount As Long) As Boolean
    'on error resume next
    If AnimationCtrl_Play(FrameStartIndex, FrameEndIndex, RepeatCount) = 1 Then
        AnimationControl_Play = True
    Else
        AnimationControl_Play = False
    End If
End Function

Public Function AnimationControl_Stop() As Boolean
    'on error resume next
    If AnimationCtrl_Stop() = 1 Then
        AnimationControl_Stop = True
    Else
        AnimationControl_Stop = False
    End If
End Function

Public Function AnimationControl_Destroy() As Boolean
    'on error resume next
    If AnimationCtrl_Destroy() = 1 Then
        AnimationControl_Destroy = True
    Else
        AnimationControl_Destroy = False
    End If
End Function

Public Sub AnimationControl_Move(ByVal X As LongByVal Y As Long)
    'on error resume next 'format: pixels
    'preset
    X = X / Screen.TwipsPerPixelX
    Y = Y / Screen.TwipsPerPixelY
    'begin
    Call AnimationCtrl_Move(X, Y)
End Sub

Public Sub AnimationControl_Show()
    'on error resume next
    Call AnimationCtrl_Show
End Sub

Public Sub AnimationControl_Hide()
    'on error resume next
    Call AnimationCtrl_Hide
End Sub


[END OF FILE]