Page 1 sur 1
[EX] Exemple avec GIFs animé (pur Autoit)
Posté : jeu. 19 juin 2008 09:15
par MClaveau
Bonjour !
Cet exemple utilise IE (embarqué) & et les fenêtres "layer" pour obtenir une trnasparence sur l'écran (le bureau).
MAIS : cela ne fonctionne que sous Vista (et WS-2008). Pour les vieux (anciens) OS (tels que W2K ou XP), voir, avec GIF89.DLL:
http://www.autoitscript.com/forum/index ... opic=73743
► Afficher le texte
Code : Tout sélectionner
#NoTrayIcon
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <IE.au3>
$choix=Random(1,4,1)
If $choix=1 Then
$w = 98
$h = 116
$gif = "ysport184.gif"
$pas = 2
$vert = 235
$delai = 12
$debut = -$w
$fin = @DesktopWidth+1
EndIf
If $choix=2 Then
$w = 130
$h = 70
$gif = "ani20.gif"
$pas = 1
$vert = 280
$delai = 12
$debut = -$w
$fin = @DesktopWidth+1
EndIf
If $choix=3 Then
$w = 139
$h = 108
$gif = "1bateau.gif"
$pas = -1
$vert = 120
$delai = 16
$debut = @DesktopWidth+1
$fin = -$w
EndIf
If $choix=4 Then
$w = 400
$h = 125
$gif = "ponx2b.gif"
$pas = 2
$vert = 400
$delai = 12
$debut = -$w
$fin = @DesktopWidth+1
EndIf
$HWnd = GUICreate("GIFanime", $w, $h, $debut, $vert, $WS_POPUP,$WS_EX_LAYERED)
$hgr=GUICtrlCreatePic("", -5,-5, $w+10, $h+10, $SS_SUNKEN)
$oIE=_IECreateEmbedded()
$GUIActiveX=GUICtrlCreateObj($oIE, -5, -5, $w+10, $h+10)
$stmp='file:///'& @ScriptDir &'\mini.htm'
_IENavigate($oIE, $stmp)
$oBody = _IETagNameGetCollection($oIE, "body", 0)
$stmp = '<HTML><BODY scroll=no><P><IMG src="'& @ScriptDir &'\'& $gif &'"></P></BODY></HTML>'
_IEDocInsertHTML($oBody, $stmp, "afterbegin")
GUISetState()
$n=$debut
$flag = True
$nb = int((@DesktopWidth+$w)/abs($pas))+1
For $i=1 To $nb
$n += $pas
WinMove($HWnd,"",$n,$vert)
Sleep($delai)
Next
$obj = 0
Exit
Cet exemple a besoin de cinq fichiers (4 GIF & 1 HTML). Ces fichiers sont dans le fichier (compressé) joint, AGIF.ZIP, sont à enregister dans le même directory que le script.
A noter que, si vous compilez le script, vous pourrez le lancer plusieurs fois simultanément.
Re: [EX] Exemple avec GIFs animé (pur Autoit)
Posté : mar. 29 juil. 2008 08:02
par SagePourpre
hmmm... Pourtant j'ai vista et ça ne marche pas.
En fait je vois bien les gif défiler sur le bureau ou plutôt le X des gif...
Aucune idée pourquoi ça ne marche pas pour moi ...