#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("WinTitleMatchMode", 2)

#Region ### START Koda GUI section ### Form=
$Window = GUICreate("Window Transparency", 452, 182, 192, 124)
$Input1 = GUICtrlCreateInput("", 24, 56, 217, 21)
$Label1 = GUICtrlCreateLabel("Gebe hier den Namen des Fensters ein.", 24, 24, 191, 17)
$Slider1 = GUICtrlCreateSlider(24, 128, 217, 25)
GUICtrlSetLimit(-1, 255, 1)
$Label2 = GUICtrlCreateLabel("Transparenz:", 24, 104, 63, 17)
$Button1 = GUICtrlCreateButton("Setzte Transparenz", 272, 40, 137, 113, $WS_GROUP)
GUICtrlSetBkColor(-1, 0xC0C0C0)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			$trans = GUICtrlRead($Slider1)
			$id = GUICtrlRead($Input1)
			If WinExists($id) Then
				WinSetTrans($id, "", $trans)
			Else
				MsgBox(0, "Error", "Error, das Fenster ist nicht geöffnet!")
			EndIf
	EndSwitch
WEnd
