Voici un petit code qui permet de déplacer le logo d'android:
► Afficher le texte
Code : Tout sélectionner
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
Dim $gauchedroite = 50, $hautbas = 200
Dim $gui = GUICreate("Plop", 700, 500, 300, 300)
Dim $android = GUICtrlCreatePic( "android.jpg", $gauchedroite, $hautbas, 80, 90)
GUISetBkColor( 0xFFFFFF)
GUISetState(@SW_SHOW)
HotKeySet( "{esc}", "_quitter")
While 1
If _IsPressed("25") Then _gauche()
If _IsPressed("27") Then _droite()
If _IsPressed("26") Then _haut()
If _IsPressed("28") Then _bas()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _gauche()
If $gauchedroite = 0 Then
$gauchedroite = 630
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
Else
$gauchedroite = $gauchedroite - 10
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
EndIf
Sleep(2)
EndFunc
Func _droite()
If $gauchedroite = 630 Then
$gauchedroite = 0
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
Else
$gauchedroite = $gauchedroite + 10
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
EndIf
Sleep(2)
EndFunc
Func _haut()
If $hautbas = 0 Then
$hautbas = 410
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
Else
$hautbas = $hautbas - 10
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
EndIf
Sleep(2)
EndFunc
Func _bas()
If $hautbas = 410 Then
$hautbas = 0
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
Else
$hautbas = $hautbas + 10
GUICtrlSetPos( $android, $gauchedroite, $hautbas)
EndIf
Sleep(2)
EndFunc
Func _quitter()
Exit
EndFunc
http://www.netpublic.fr/wp-content/uplo ... ndroid.jpg
Merci.