#Include <WindowsConstants.au3>
#Include <WinAPIEx.au3>
#Include <GDIPlus.au3>
HotKeySet('{ESC}', '_Exit')
Global $Array[1][3] = [[0, 0, 0]]
$hForm = GUICreate('', @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
GUISetBkColor(0x000000)
For $i = 0 To 99
$X = Random(30, @DesktopWidth - 30, 1)
$Y = Random(30, @DesktopHeight - 30, 1)
$Array[0][0] += 1
ReDim $Array[$Array[0][0] + 1][UBound($Array, 2)]
$Array[$Array[0][0]][0] = GUICreate('', 30, 30, $X, $Y, $WS_POPUP, $WS_EX_LAYERED, $hForm)
$Array[$Array[0][0]][1] = DllCallbackRegister('Move', 'lresult', 'hwnd;ulong;wparam;lparam')
$Array[$Array[0][0]][2] = _WinAPI_SetTimer($Array[$Array[0][0]][0], TimerInit(), 10, DllCallbackGetPtr($Array[$Array[0][0]][1]))
LoadImage($Array[$Array[0][0]][0], @ScriptDir & '\1.gif')
GUISetState(@SW_SHOW)
Next
_WinAPI_SetLayeredWindowAttributes($hForm, 0x000000, 255)
GUISetState(@SW_SHOW, $hForm)
While 1
Sleep(10)
Wend
Func _Exit()
For $i = 0 To $Array[0][0]
DllCallbackFree($Array[$i][1])
_WinAPI_KillTimer($Array[$i][0], $Array[$i][2])
GUIDelete($Array[$i][0])
Next
GUIDelete($hForm)
Exit
EndFunc
Func Move($hWnd, $iMsg, $wParam, $lParam)
$iPos = WinGetPos($hWnd)
If $iPos[1] >= @DesktopHeight Then
WinMove($hWnd, '', $iPos[0] + Random(0, 10, 1), -30, $iPos[2], $iPos[3])
Else
WinMove($hWnd, '', $iPos[0], $iPos[1] + 5, $iPos[2], $iPos[3])
EndIf
EndFunc
Func LoadImage($hWnd, $sImage)
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_WinAPI_UpdateLayeredWindowEx($hWnd, -1, -1, $hBitmap)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
EndFunc