#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <String.au3>

#NoTrayIcon

Local $GUIEins, $GUIZwei, $Button1, $FensterAnmelden

Func _CloseDesktop_Typ1($Farbe1 = 0xFFFF00, $Farbe2 = 0xFFFF00, $Geschwindigkeit = 2)
	$GUIEins = GUICreate("CloseDesktop.1", @DesktopWidth, 0, 0, 0, 0x80000000, BitOR(0x00000080, 0x00000008))
	$GUIZwei = GUICreate("CloseDesktop.2", @DesktopWidth, 0, 0, @DesktopHeight, 0x80000000, BitOR(0x00000080, 0x00000008))

	GUISetBkColor($Farbe1, $GUIEins)
	GUISetBkColor($Farbe2, $GUIZwei)

	GUISetState(@SW_SHOW, $GUIEins)
	GUISetState(@SW_SHOW, $GUIZwei)

	For $i = 1 To (@DesktopHeight / 2 + 5) Step $Geschwindigkeit
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, $i)
		WinMove("CloseDesktop.2", "", 0, (@DesktopHeight) - $i, @DesktopWidth, $i)
	Next
EndFunc   ;==>_CloseDesktop_Typ1

Func _CloseDesktop_Typ2($Farbe1 = 0xFFFF00, $Farbe2 = 0xFFFF00, $Geschwindigkeit = 2)
	$GUIEins = GUICreate("CloseDesktop.1", @DesktopWidth, 0, 0, 0, 0x80000000, BitOR(0x00000080, 0x00000008))
	$GUIZwei = GUICreate("CloseDesktop.2", @DesktopWidth, 35, 0, @DesktopHeight - 35, 0x80000000, BitOR(0x00000080, 0x00000008))

	GUISetBkColor($Farbe1, $GUIEins)
	GUISetBkColor($Farbe2, $GUIZwei)

	GUISetState(@SW_SHOW, $GUIEins)
	GUISetState(@SW_SHOW, $GUIZwei)

	For $i = 1 To (@DesktopHeight - 35) Step $Geschwindigkeit
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, $i)
	Next
EndFunc   ;==>_CloseDesktop_Typ2

Func _OpenDesktop_Typ1($VonModus = 1, $Geschwindigkeit = 2)
	If $VonModus = 2 Then
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, @DesktopHeight / 2 + 5)
		WinMove("CloseDesktop.2", "", 0, (@DesktopHeight / 2 + 5))
	EndIf

	For $i = (@DesktopHeight / 2 + 5) To 1 Step -$Geschwindigkeit
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, $i)
		WinMove("CloseDesktop.2", "", 0, (@DesktopHeight) - $i, @DesktopWidth, $i)
	Next

	GUIDelete($GUIEins)
	GUIDelete($GUIZwei)
EndFunc   ;==>_OpenDesktop_Typ1

Func _OpenDesktop_Typ2($VonModus = 2, $Geschwindigkeit = 2)
	If $VonModus = 1 Then
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, @DesktopHeight - 35)
		WinMove("CloseDesktop.2", "", 0, @DesktopHeight - 35, @DesktopWidth, 35)
	EndIf

	For $i = (@DesktopHeight - 35) To 1 Step -$Geschwindigkeit
		WinMove("CloseDesktop.1", "", 0, 0, @DesktopWidth, $i)
	Next

	GUIDelete($GUIEins)
	GUIDelete($GUIZwei)
EndFunc   ;==>_OpenDesktop_Typ2

Func _SperreTaskleiste($Farbe = 0xFF0000, $Einblenden = 1, $Geschwindigkeit = 2)
	If $Einblenden = 0 Then
		$GUIEins = GUICreate("CloseDesktop.1", @DesktopWidth, 35, 0, @DesktopHeight - 35, 0x80000000, BitOR(0x00000080, 0x00000008))
	Else
		$GUIEins = GUICreate("CloseDesktop.1", @DesktopWidth, 0, 0, @DesktopHeight, 0x80000000, BitOR(0x00000080, 0x00000008))
	EndIf

	GUISetBkColor($Farbe, $GUIEins)
	GUISetState(@SW_SHOW, $GUIEins)

	If $Einblenden = 1 Then
		For $i = @DesktopHeight To (@DesktopHeight - 35) Step -$Geschwindigkeit
			WinMove("CloseDesktop.1", "", 0, $i, @DesktopWidth, (@DesktopHeight - $i), $i)
		Next
	EndIf
EndFunc   ;==>_SperreTaskleiste

Func _EntsperreTaskleiste($Ausblenden = 1, $Geschwindigkeit = 2)
	If $Ausblenden = 1 Then
		For $i = (@DesktopHeight - 35) To @DesktopHeight Step $Geschwindigkeit
			WinMove("CloseDesktop.1", "", 0, $i, @DesktopWidth, (@DesktopHeight - $i), $i)
		Next
	EndIf

	GUIDelete($GUIEins)
EndFunc   ;==>_EntsperreTaskleiste