Ich hab da jetzt noch ein Problem mit den durchsichtigen Ellipsen. Ich hab jetzt ein sich öffnendes Auge gezeichnet, aber es flimmert.
Skript:
Sich öffnendes Auge
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Anzahl = @DesktopWidth / 2
Global Const $WS_EX_COMPOSITED = 0x2000000
Global $Ellipse[$Anzahl]
$my_gui = GUICreate("MyGUI", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP,BitOR( $WS_EX_TOPMOST,$WS_EX_LAYERED, $WS_EX_COMPOSITED))
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
For $i = $Anzahl - 1 To 1 Step -1
$Ellipse[$i] = _DrawTransparentEllipse ($my_gui, @DesktopWidth/16, @DesktopHeight/8 + $i / 2, @DesktopWidth/1.15, @DesktopHeight/1.30 - $i, 255)
Sleep (5)
If $i > 1 Then
GUIDelete ($Ellipse[$i-1])
EndIf
Next
While 1
Sleep (100)
WEnd
Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
; progandy
If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
Select
Case @error
Return SetError(@error, 0, 0)
Case $Ret[0] = 0
Return SetError(4, _WinAPI_GetLastError(), 0)
Case Else
Return 1
EndSelect
EndFunc ;==>_WinAPI_SetLayeredWindowAttributes
Func _Exit()
Exit
EndFunc
Func _DrawTransparentEllipse($hwnd, $x, $y, $w, $h, $Transparency = 255)
$Child=GUICreate ("", $w, $h, $x, $y, $WS_CHILD, -1, $hwnd )
_WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency)
GUISetBkColor (0xABCDEF, $Child )
_GuiRoundCorners ($Child, 0, 0, $w, $h)
GUISetState()
Return $Child
EndFunc
Func _GuiRoundCorners($hWnd, $x1, $y1, $x3, $y3)
Local $pos, $ret, $ret2
$pos = WinGetPos($hWnd)
$ret = DllCall('gdi32.dll', 'long', 'CreateRoundRectRgn', 'long', $x1, 'long', $y1, 'long', $pos[2], 'long', $pos[3], 'long', $x3, 'long', $y3)
If $ret[0] Then
$ret2 = DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $hWnd, 'long', $ret[0], 'int', 1)
If $ret2[0] Then
Return 1
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc
Hätte wer eine Lösung gegen das flimmern?