als nächstes kommt die Funktion rein die unsere Gui transparent macht.
die sieht so aus :
PHP Code:
Func Transparenz($hWnd,$leftw,$rightw,$toph,$bottomh) ;Anfang der Funktion, die variabeln enthalten die Größe der Gui (hier im Beispiel 300)
$struct=c("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;"); Hier wird eine Dll Struktur erstellt.
DllStructSetData($struct,"cxLeftWidth",$leftw) ;In die gerade erstellte Struktur werden jetzt die oben angegeben Werte ($leftw, $rightw , $toph und $bottomh) gesetzt.
DllStructSetData($struct,"cxRightWidth",$rightw)
DllStructSetData($struct,"cyTopHeight",$toph)
DllStructSetData($struct,"cyBottomHeight",$bottomh)
GUISetBkColor("0x000000"); Wenn man hier einen anderen Hex Farbwert einträgt ist die Tönung etwas anders
Return DllCall("dwmapi.dll", "int", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($struct)) ; Und Zum Schluss wird noch die Funktion aufgerufen.
EndFunc
;Ende der Funktion ;)
Wenn wir sie jetzt in unser Grundgerüst einbauen müsste das so ausssehen :
PHP Code:
#include <StructureConstants.au3>
#include <GUIConstants.au3>
$GUI = GUICreate("How To Transparente Gui", 300, 300)
GUISetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
Wend
Func Transparenz($hWnd,$leftw,$rightw,$toph,$bottomh)
$struct=DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;")
DllStructSetData($struct,"cxLeftWidth",$leftw)
DllStructSetData($struct,"cxRightWidth",$rightw)
DllStructSetData($struct,"cyTopHeight",$toph)
DllStructSetData($struct,"cyBottomHeight",$bottomh)
GUISetBkColor("0x000000")
Return DllCall("dwmapi.dll", "int", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($struct))
EndFunc