Hi!
Ich hab hier eine UDF zu Transparenz (von Progandy ). Ich komm mit der allerdings nicht ganz klar, bzw sie hat keinen Effekt.
Spoiler anzeigen
#include<WindowsConstants.au3>
[/autoit] [autoit][/autoit] [autoit]$gui = GUICreate("Test", 563, 318, 283, 181, $WS_EX_LAYERED)
$slidTrans = GUICtrlCreateSlider(10, 70, 200, 30)
GUICtrlSetLimit($slidTrans, 255, 0)
GUICtrlSetData(-1, 255)
GUISetState(@SW_SHOW)
While 1
_API_SetLayeredWindowAttributes($gui,0x010101,255)
WEnd
;===============================================================================
;
; Function Name: _API_SetLayeredWindowAttributes
; Description:: Sets Layered Window Attributes:) See MSDN for more informaion
; Parameter(s):
; $hwnd - Handle of GUI to work on
; $i_transcolor - Transparent color
; $Transparency - Set Transparancy of GUI
; $isColorRef - If True, $i_transcolor is a COLORREF-Strucure, else an RGB-Color
; Requirement(s): Layered Windows
; Return Value(s): Success: 1
; Error: 0
; @error: 1 to 3 - Error from DllCall
; @error: 4 - Function did not succeed - use
; _WinAPI_GetLastErrorMessage or _WinAPI_GetLastError to get more information
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)
Local Const $AC_SRC_ALPHA = 1
Local Const $ULW_ALPHA = 2
Local Const $LWA_ALPHA = 0x2
Local Const $LWA_COLORKEY = 0x1
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", $LWA_COLORKEY + $LWA_ALPHA)
Select
Case @error
Return SetError(@error,0,0)
Case $ret[0] = 0
Return SetError(4,0,0)
Case Else
Return 1
EndSelect
EndFunc ;==>_API_SetLayeredWindowAttributes
Kann mir jemand sagen warum das nicht funzt? Was hab ich vergessen?
fabs