Hallo,
ich habe mir ein Hovereffekt geschrieben. Das ist schon und gut, flakkert nicht.
Jetzt habe ich das in eine andere Form gestopft und tada es flakert richtig doll. Was muss ich ändern damit das nicht mehr flakkert ?
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <SendMessage.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $minimieren, $schliesen, $Form, $buttons[1][2], $TEMPDIR = ".\bilder", $hover
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 383, 209, 294, 244, $WS_POPUP)
$titel_balken = GUICtrlCreatePic ("",0,0,500,22)
$Pic1 = GUICtrlCreatePic($TEMPDIR & "\bg.gif", 0, 0, 382, 208)
$buttons[0][0] = GUICtrlCreatePic($TEMPDIR & "\start0.jpg", 4, 27, 155, 35)
$buttons[0][1] = "start"
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister ("_GUI_hover",200)
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $titel_balken
_SendMessage($Form1, $WM_SYSCOMMAND, 0xF012, 0)
EndSwitch
_GUI_hover()
WEnd
Func _GUI_hover()
Local $iMouse = GUIGetCursorInfo($Form1)
If Not @error Then
For $i = 0 To UBound($buttons) - 1
Local $bPos = ControlGetPos($Form, "", $buttons[$i][0])
If ($iMouse[0] >= $bPos[0]) And ($iMouse[0] <= $bPos[0] + $bPos[2]) And ($iMouse[1] >= $bPos[1]) And ($iMouse[1] <= $bPos[1] + $bPos[3]) Then
If $iMouse[2] = 0 Then
GUICtrlSetImage($buttons[$i][0], $TEMPDIR & "\" & $buttons[$i][1] & "1.jpg")
Else
GUICtrlSetImage($buttons[$i][0], $TEMPDIR & "\" & $buttons[$i][1] & "2.jpg")
EndIf
Else
GUICtrlSetImage($buttons[$i][0], $TEMPDIR & "\" & $buttons[$i][1] & "0.jpg")
EndIf
Next
EndIf
EndFunc ;==>_GUI_hover