#include-once

Global $anigif_dll =  DllOpen("ani_gif.dll")
Func _animgif($ani_filename, $ani_image, $Whwnd = 0  , $X = 0 , $Y = 0  )
	AnimatedGif(GdipLoadImageFromFile($ani_filename, $ani_image) ,$Whwnd, $X, $Y)
EndFunc

Func GdipLoadImageFromFile($ani_filename = 0, $ani_image = 0)
$DllCall = DllCall($anigif_dll , "int:cdecl" , "GdipLoadImageFromFile" , "wstr" , $ani_filename , "int*" , $ani_image = 0 )
Return SetError ( $DllCall[0], 0 , $DllCall[UBound($DllCall)- 1])
EndFunc

Func AnimatedGif($hBitmap = 0 , $Whwnd = 0  , $X = 0 , $Y = 0 )
$DllCall = DllCall($anigif_dll , "int:cdecl" , "AnimatedGif" , "hwnd" , $hBitmap, "hwnd" ,$Whwnd, "int" , $X , "int" , $Y )
Return SetError ( $DllCall[0], 0 , $DllCall[UBound($DllCall)- 1])
EndFunc

Func PauseAnimatedGif($hBitmap , $Bool)
$DllCall = DllCall($anigif_dll , "int:cdecl" , "PauseAnimatedGif" , "hwnd" , $hBitmap, "int" ,$Bool)
Return SetError ( $DllCall[0], 0 , $DllCall[UBound($DllCall)- 1])
EndFunc

Func GplusShutdown()
$DllCall = DllCall($anigif_dll , "int:cdecl" , "GplusShutdown")
Return SetError ( $DllCall[0], 0 , $DllCall[UBound($DllCall)- 1])
EndFunc

Func closedll()
	GplusShutdown()
	DllClose($anigif_dll)
EndFunc
