Has anyone got this working in VB? This is what I have:

*** HEADER FILE ***

Public Type SMALL_RECT
Left As Integer
Top As Integer
Right As Integer
Bottom As Integer
End Type

Declare Function DrawAnimatedRects Lib "user32" (ByVal hwnd As Long, ByVal idAni As Integer, ByRef lprcFrom As SMALL_RECT, ByRef lprcTo As SMALL_RECT)

*** CALLING FUNCTION ****

Private mox, moy As Single ' in declarations

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Dim area_rect As SMALL_RECT
Dim full_rect As SMALL_RECT

full_rect.Left = 0
full_rect.Top = 0
full_rect.Right = Picture1.Width
full_rect.Bottom = Picture1.Height

area_rect.Left = mox ' set by mouse_down (local)
area_rect.Right = X
area_rect.Top = moy ' set by mouse_down (local)
area_rect.Bottom = Y

DrawAnimatedRects Picture1.hwnd, 0, area_rect, full_rect

End Sub


When I run the program I get "Run time error 49, Bad Dll calling convention"

Do you know where I am going wrong?

Cheers