Projekt: Window(s) Management

  • Update 01.10.08

    ToDo:

    Spoiler anzeigen

    weitere Ideen sind natürlich gerne gesehen, also auf gehts =)

    Programm in Post2, ohne AutoIt-Tags, da ansonsten ein leeres Post angezeigt wird, kein plan wieso

  • Spoiler anzeigen

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=..\_Icons\bitch.ico
    #AutoIt3Wrapper_Run_Obfuscator=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    ; neue Funktionen
    ; Fenster in Tray minimieren -> sample_Win2Tray.au3!
    ; kontextmenüeintrag in der taskleiste -> RegHack?
    ; verschieben in taskleiste/systray -> Taskbar_UDF?/ Systray_UDF!
    ; Tray-Icons verstecken -> Systray_UDF!

    ;-----------------------------------------------------------------------------
    ; Includes
    ;-----------------------------------------------------------------------------

    ;~ #include <SysTray_UDF.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    #include <Process.au3>
    #include <File.au3>
    #include <GUIConstants.au3>
    #Include <GuiListView.au3>
    #include <GuiConstantsEx.au3>
    #Include <GuiEdit.au3>
    #Include <GuiMenu.au3>
    #Include <GuiTab.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <SliderConstants.au3>
    #include <Constants.au3>

    ;-----------------------------------------------------------------------------
    ; 1 Instance
    ;-----------------------------------------------------------------------------

    If _Singleton(@ScriptName, 1) = 0 Then
    Msgbox(16,"Warning","An occurence is already running", 10)
    Exit
    EndIf

    ;-----------------------------------------------------------------------------
    ; Options
    ;-----------------------------------------------------------------------------

    Opt("GUIOnEventMode", 1)
    Opt("WinTitleMatchMode", 2)
    Opt("OnExitFunc", "_OnExitFunc")
    Opt("GUICloseOnESC", 0)
    Opt("MustDeclareVars", 0)

    Opt("TrayMenuMode",1)
    Opt("TrayOnEventMode",1)
    TraySetClick(8)

    ;-----------------------------------------------------------------------------
    ; Variablen
    ;-----------------------------------------------------------------------------

    Global $ini = @scriptdir & "\Settings.ini"
    Global $iniTop = @scriptdir & "\Window_Top.ini"
    Global $iniTray = @scriptdir & "\Window_Tray.ini"
    Global $iniHide = @scriptdir & "\Window_Hide.ini"
    Global $iniTTI = @scriptdir & "\Window_TTi.ini"
    Global $iniTrans = @scriptdir & "\Window_Trans.ini"
    Global $iniMove = @scriptdir & "\Window_Move.ini"

    Global $WinList, $var2, $tInfo, $ListView1, $B_DESCENDING, $HowToSort, $DoubleAction = "do Nothing";, $TRAY_EVENT_PRIMARYDOWN, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $TBS_BOTTOM, $TBS_VERT, $WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE, $WM_NOTIFY, $WS_EX_TRANSPARENT, $TBS_TOP, $GWL_EXSTYLE, $Style,$WS_EX_LAYERED, $NM_DBLCLK, $NM_DBLCLK
    Global $transwins, $wins, $Transparency, $i_transcolor, $Window, $Window_Trans, $WinGetHandle, $opt1, $opt2, $Position, $WinGetTitle, $ProcessName, $WinPos
    Global $ToogleTray = 0

    Global $Title = "Window Management DeluxXx Edition V++"

    $dll = DllOpen("user32.dll")

    If IniRead($ini, "Settings", "Show Tray-Icon on Start", "1") <> 1 Then Opt("TrayIconHide", 1)
    If IniRead($ini, "Settings", "Enable Hotkeys on Start", "1") <> 1 Then
    Global $HotKeySet = False
    Else
    HotKeySet("{F9}","_HKToggleTop") ;set active window on top or back
    HotKeySet("{F10}", "_HKToogleTrans") ;set trans to window or back
    HotKeySet("{F7}", "_HKWindowHide") ;hide window
    HotKeySet("^!{F7}", "_AllWindowHideBack") ;set hide back on all windows
    HotKeySet("{F8}", "_HKWindowTray") ;hide window to tray
    HotKeySet("^!{F8}", "_AllWindowTrayBack") ;set hide to tray back on all windows
    HotKeySet("!^{INS}", "_HKWindowTransNoClick") ;set immun to window
    HotKeySet("!{INS}", "_AllWindowTransNoClickBack") ;set immun back on all windows

    HotKeySet("!{PGUP}", "_TransPlus") ;set window-trans +10
    HotKeySet("!{PGDN}", "_TransMinus") ;set window-trans -10

    HotKeySet("!{UP}", "_HKMoveWindowUP") ;move active window to top
    HotKeySet("!{DOWN}", "_HKMoveWindowDOWN") ;move active window to bottom
    HotKeySet("!{LEFT}", "_HKMoveWindowLEFT") ;move active window to left
    HotKeySet("!{RIGHT}", "_HKMoveWindowRIGHT") ;move active window to right
    HotKeySet("!^{F9}", "_HKMoveWindowMax") ;maximize active window

    HotKeySet("{F11}","_ExploreVertical") ;show 2 vertical explorer windows
    HotKeySet("!{F11}","_ExploreHorizontal") ;show 2 horizontal explorer windows
    HotKeySet("!^s","_ToogleHiddenFiles") ;show/hide hidden filesGlobal $HotKeySet = False
    Global $HotKeySet = True
    EndIf
    If IniRead($ini, "Settings", "Update Window List", "4") = 1 Then AdlibEnable("_UpdateListView", IniRead($ini, "Update Window List", "every Sec.", 10) * 1000)
    If IniRead($ini, "Settings", "Enable automatic Sort", "4") = 1 Then $HowToSort = IniRead($ini, "Sort", "Method", "don´t Sort")
    If IniRead($ini, "Settings", "Action for double-click on Item", "4") = 1 Then $DoubleAction = IniRead($ini, "Action", "Double-Click", "do Nothing")

    ;-----------------------------------------------------------------------------
    ; TrayMenü
    ;-----------------------------------------------------------------------------

    TraySetToolTip($Title)
    TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "_TrayLClick")
    ;TraySetOnEvent($TRAY_EVENT_SecondaryDOWN, "_TrayRClick")

    $TrayMenu1 = TrayCreateMenu("Corner")
    $TrayItem1 = TrayCreateItem("Left Top", $TrayMenu1)
    TrayItemSetOnEvent($TrayItem1, "_TrayLeftTop")
    $TrayItem2 = TrayCreateItem("Right Top", $TrayMenu1)
    TrayItemSetOnEvent($TrayItem2, "_TrayRightTop")
    $TrayItem3 = TrayCreateItem("Center", $TrayMenu1)
    TrayItemSetOnEvent($TrayItem3, "_TrayCenter")
    $TrayItem4 = TrayCreateItem("Right Bottom", $TrayMenu1)
    TrayItemSetOnEvent($TrayItem4, "_TrayRightBottom")
    $TrayItem5 = TrayCreateItem("Left Bottom", $TrayMenu1)
    TrayItemSetOnEvent($TrayItem5, "_TrayLeftBottom")
    $IniCorner = IniRead($ini, "Position", "Corner", "4")
    If $IniCorner = 1 Then
    TrayItemSetState($TrayItem1, 1)
    ElseIf $IniCorner = 2 Then
    TrayItemSetState($TrayItem2, 1)
    ElseIf $IniCorner = 3 Then
    TrayItemSetState($TrayItem3, 1)
    ElseIf $IniCorner = 4 Then
    TrayItemSetState($TrayItem4, 1)
    ElseIf $IniCorner = 5 Then
    TrayItemSetState($TrayItem5, 1)
    EndIf
    TrayCreateItem("")
    $TrayItem6 = TrayCreateItem("Enable Hotkeys" & @TAB & "[ALT Gr + Space]")
    TrayItemSetOnEvent($TrayItem6, "_HotKeySet")
    TrayItemSetState($TrayItem6, IniRead($ini, "Settings", "Enable Hotkeys on Start", "1"))
    $TrayItem6a = TrayCreateItem("Sort Systray-Icons" & @TAB & "[ALT + T]")
    TrayItemSetOnEvent($TrayItem6a, "_SortSysTray")
    TrayCreateItem("")
    $TrayItem7 = TrayCreateItem("Open" & @TAB & "[ALT + ESC]")
    TrayItemSetOnEvent($TrayItem7, "_TrayOpen")
    $TrayItem7a = TrayCreateItem("Help")
    TrayItemSetOnEvent($TrayItem7a, "_Help")
    TrayCreateItem("")
    $TrayItem8 = TrayCreateItem("Exit")
    TrayItemSetOnEvent($TrayItem8, "_TrayExit")
    ;-----------------------------------------------------------------------------
    ; Hotkeys
    ;-----------------------------------------------------------------------------

    HotKeySet("^!{Space}", "_HotKeySet") ;show/hide WRiTeR
    HotKeySet("!{ESC}", "_ToogleMain") ;show/hide main-window
    HotKeySet("!^{ESC}", "_EndScript") ;show/hide main-window
    HotKeySet("^!m", "_ToogleTray") ;show/hide Tray
    HotKeySet("^!p", "_ToogleWRiTeR") ;show/hide WRiTeR

    ;-----------------------------------------------------------------------------
    ; Create GUI
    ;-----------------------------------------------------------------------------


    #Region ### START Koda GUI section ### Form=o:\autoscripts\window management\form1.kxf

    $Form1_1 = GUICreate($Title, 510, 301, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU ,$DS_SETFOREGROUND), $WS_EX_TOPMOST)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_EndScript")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "_MinMain")
    $Menu1 = GUICtrlCreateMenu("&File")
    $Menu1_1 = GUICtrlCreateMenuItem("Hide Tray" & @TAB & "[ALT Gr + M]", $Menu1)
    GUICtrlSetOnEvent($Menu1_1, "_ToogleTray")
    $Menu1_2 = GUICtrlCreateMenuItem("Enable Hotkeys" & @TAB & "[ALT Gr + Space]", $Menu1)
    GUICtrlSetOnEvent($Menu1_2, "_HotKeySet")
    GUICtrlSetState($Menu1_2, IniRead($ini, "Settings", "Enable Hotkeys on Start", "1"))
    GUICtrlCreateMenuItem("", $Menu1)
    $Menu1_3 = GUICtrlCreateMenuItem("Expert Mode" & @TAB & "", $Menu1)
    GUICtrlSetOnEvent($Menu1_3, "_Settings")
    GUICtrlCreateMenuItem("", $Menu1)
    $Menu1_4 = GUICtrlCreateMenuItem("Exit" & @TAB & "[ALT Gr + ESC]", $Menu1)
    GUICtrlSetOnEvent($Menu1_4, "_EndScript")
    $Menu2 = GUICtrlCreateMenu("&Explorer")
    $Menu2_1 = GUICtrlCreateMenuItem("2 Windows Vertical" & @TAB & "[F11]", $Menu2)
    GUICtrlSetOnEvent($Menu2_1, "_ExploreVertical")
    $Menu2_2 = GUICtrlCreateMenuItem("2 Windows Horizontal" & @TAB & "[ALT + F11]", $Menu2)
    GUICtrlSetOnEvent($Menu2_2, "_ExploreHorizontal")
    $Menu2_3 = GUICtrlCreateMenuItem("", $Menu2)
    $Menu2_4 = GUICtrlCreateMenuItem("Show Hidden Files" & @TAB & "[ALT Gr + S]", $Menu2)
    GUICtrlSetOnEvent($Menu2_4, "_ToogleHiddenFiles")
    $i_State = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden")
    If $i_State = 1 Then
    GUICtrlSetState($Menu2_4, $GUI_checked)
    ElseIf $i_State = 2 Then
    GUICtrlSetState($Menu2_4, $GUI_unchecked)
    EndIf
    $Menu3 = GUICtrlCreateMenu("&More")
    $Menu3_1 = GUICtrlCreateMenuItem("Help" & @TAB & "[F1]", $Menu3)
    GUICtrlSetOnEvent($Menu3_1, "_Help")
    $Menu3_2 = GUICtrlCreateMenuItem("About" & @TAB & "", $Menu3)
    GUICtrlSetOnEvent($Menu3_2, "_About")
    $PageControl1 = GUICtrlCreateTab(0, 0, 508, 280)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    $TabSheet1 = GUICtrlCreateTabItem("Windows")
    $ListView = GUICtrlCreateListView("Process|Window|Top|Tray|Hide|TTI|Trans|Handle", 3, 23, 439, 228, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_HEADERDRAGDROP,$LVS_EX_FULLROWSELECT))
    $ListView1 = GUICtrlGetHandle($ListView)
    _GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_HEADERDRAGDROP,$LVS_EX_FULLROWSELECT))
    _GUICtrlListView_SetColumnWidth($ListView1, 0, 80)
    _GUICtrlListView_SetColumnWidth($ListView1, 1, 170)
    _GUICtrlListView_SetColumnWidth($ListView1, 2, 35)
    _GUICtrlListView_SetColumnWidth($ListView1, 3, 35)
    _GUICtrlListView_SetColumnWidth($ListView1, 4, 35)
    _GUICtrlListView_SetColumnWidth($ListView1, 5, 35)
    _GUICtrlListView_SetColumnWidth($ListView1, 6, 45)
    _GUICtrlListView_SetColumnWidth($ListView1, 7, 0)
    $Button1 = GUICtrlCreateButton("update", 3, 253, 342, 25, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button1, "_UpdateListView")
    $Button2 = GUICtrlCreateButton("Top", 448, 28, 55, 20, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button2, "_BToogleTop")
    $Button3 = GUICtrlCreateButton("Tray", 448, 63, 55, 20, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetState($Button3, $GUI_Disable)
    GUICtrlSetOnEvent($Button3, "_BWindowTray")
    $Button4 = GUICtrlCreateButton("Hide", 448, 99, 55, 20, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button4, "_BWindowHide")
    $Button5 = GUICtrlCreateButton("T T I", 448, 134, 55, 20, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button5, "_BWindowTransNoClick")
    $Button6 = GUICtrlCreateButton("Trans", 448, 169, 55, 20, 0, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button6, "_BToogleTrans")
    $Button7 = GUICtrlCreateButton("<", 350, 253, 20, 25, BitOR($WS_TABSTOP, $BS_NOTIFY, $BS_CENTER, $BS_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button7, "_BMoveWindowLeft")
    $Button8 = GUICtrlCreateButton("^", 375, 253, 20, 25, BitOR($WS_TABSTOP, $BS_NOTIFY, $BS_CENTER, $BS_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button8, "_BMoveWindowUP")
    $Button9 = GUICtrlCreateButton("v", 400, 253, 20, 25, BitOR($WS_TABSTOP, $BS_NOTIFY, $BS_CENTER, $BS_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button9, "_BMoveWindowDown")
    $Button10 = GUICtrlCreateButton(">", 425, 253, 20, 25, BitOR($WS_TABSTOP, $BS_NOTIFY, $BS_CENTER, $BS_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetOnEvent($Button10, "_BMoveWindowRight")
    $Slider1 = GUICtrlCreateSlider(455, 193, 20, 80, $TBS_VERT)
    GUICtrlCreateLabel("0", 485, 195)
    GUICtrlCreateLabel("255", 480, 255)
    GUICtrlSetLimit($Slider1,255,0)
    GUICtrlSetData($Slider1, IniRead($ini, "Transparence", "Trans", 200))
    $TabSheet2 = GUICtrlCreateTabItem("WRiTeR")
    $Edit = GUICtrlCreateEdit("", 2, 22, 503, 255)
    $Edit1 = GUICtrlGetHandle($Edit)
    _GUICtrlEdit_CanUndo($Edit1)
    _GUICtrlEdit_SetText($Edit1, StringReplace(IniRead($ini, "WRiTeR", "Notes", ""), "[CRLF]" ,@CRLF))

    $TabSheet3 = GUICtrlCreateTabItem("Settings")
    $Group1 = GUICtrlCreateGroup("GUI Postition", 10, 30, 250, 90)
    $Radio1 = GUICtrlCreateRadio("Left Top", 20, 50, 65)
    $Radio2 = GUICtrlCreateRadio("Right Top", 170, 50, 70)
    $Radio3 = GUICtrlCreateRadio("Center", 100, 70, 55)
    $Radio4 = GUICtrlCreateRadio("Right Bottom", 170, 90, 80)
    $Radio5 = GUICtrlCreateRadio("Left Bottom", 20, 90, 80)
    $IniCorner = IniRead($ini, "Position", "Corner", "4")
    If $IniCorner = 1 Then
    GUICtrlSetState($Radio1, 1)
    WinMove($Title, '', 0, 0)
    ElseIf $IniCorner = 2 Then
    GUICtrlSetState($Radio2, 1)
    WinMove($Title, '', @DesktopWidth - 515, 0)
    ElseIf $IniCorner = 3 Then
    GUICtrlSetState($Radio3, 1)
    ;WinMove($Title, '', (@DesktopWidth / 2) - (515 / 2), (@DesktopHeight / 2) - (350 / 2))
    ElseIf $IniCorner = 4 Then
    GUICtrlSetState($Radio4, 1)
    WinMove($Title, '', @DesktopWidth - 515, @DesktopHeight - 350)
    ElseIf $IniCorner = 5 Then
    GUICtrlSetState($Radio5, 1)
    WinMove($Title, '', 0, @DesktopHeight - 350)
    EndIf
    $Group2 = GUICtrlCreateGroup("Transparence", 10, 130, 250, 115)
    GUICtrlCreateLabel("TRANS-Func", 25, 155, 100, 30)
    $SSlider1 = GUICtrlCreateSlider(105, 150, 140, 30, $TBS_BOTTOM)
    GUICtrlSetLimit($SSlider1, 255, 0)
    GUICtrlSetData($SSlider1, IniRead($ini, "Transparence", "Trans", 200))
    GUICtrlCreateLabel("TTI-Func", 25, 210, 100, 30)
    $SSlider2 = GUICtrlCreateSlider(105, 205, 140, 30, $TBS_TOP)
    GUICtrlSetLimit($SSlider2, 255, 0)
    GUICtrlCreateLabel("0", 115, 185)
    GUICtrlCreateLabel("255", 220, 185)
    GUICtrlSetData($SSlider2, IniRead($ini, "Transparence", "TTI", 50))
    $Group3 = GUICtrlCreateGroup("Extras", 270, 30, 230, 245)
    $SButton1 = GUICtrlCreateButton("standard", 30, 250, 80)
    GUICtrlSetOnEvent($SButton1, "_StandardSettings")
    $SButton2 = GUICtrlCreateButton("apply", 160, 250, 80)
    GUICtrlSetOnEvent($SButton2, "_ApplySettings")
    $Checkbox1 = GUICtrlCreateCheckbox("Run with Windows", 280, 45, 120)
    GUICtrlSetState($Checkbox1, IniRead($ini, "Settings", "Run with Windows", "4"))
    $Checkbox2 = GUICtrlCreateCheckbox("Show Tray-Icon on Start", 280, 65, 140)
    GUICtrlSetState($Checkbox2, IniRead($ini, "Settings", "Show Tray-Icon on Start", "1"))
    $Checkbox3 = GUICtrlCreateCheckbox("Enable Hotkeys on Start", 280, 85, 140)
    GUICtrlSetState($Checkbox3, IniRead($ini, "Settings", "Enable Hotkeys on Start", "1"))
    $checkbox3a = GUICtrlCreateCheckbox("Show Window on Start", 280, 105, 140)
    GUICtrlSetState($Checkbox3a, IniRead($ini, "Settings", "Show Window on Start", "4"))
    $Checkbox4 = GUICtrlCreateCheckbox("update Window-List every", 280, 125, 142)
    GUICtrlSetState($Checkbox4, IniRead($ini, "Settings", "update Window List", "4"))
    GUICtrlSetOnEvent($Checkbox4, "_EnableUpdate")
    $Input1 = GUICtrlCreateInput(IniRead($ini, "Update Window List", "every Sec.", 10), 427, 125, 40)
    _EnableUpdate()
    GUICtrlCreateLabel("Sec.", 472, 130, 30)
    $Checkbox5 = GUICtrlCreateCheckbox("Enable automatic Sort", 280, 145, 123)
    GUICtrlSetState($Checkbox5, IniRead($ini, "Settings", "Enable automatic Sort", "4"))
    GUICtrlSetOnEvent($Checkbox5, "_EnableSort")
    $Combo1 = GUICtrlCreateCombo("", 340, 165, 90)
    GUICtrlSetData($Combo1, "don´t Sort|Ascending|Descending", IniRead($ini, "Sort", "Method", "don´t Sort"))
    _EnableSort()
    $Checkbox6 = GUICtrlCreateCheckbox("Action for double-click on Item", 280, 187, 165)
    GUICtrlSetState($Checkbox6, IniRead($ini, "Settings", "Action for double-click on Item", "4"))
    GUICtrlSetOnEvent($Checkbox6, "_EnableDoubleClick")
    $Combo2 = GUICtrlCreateCombo("", 310, 207, 150)
    GUICtrlSetData($Combo2, "do Nothing|Show/Hide Window|Set on Top/Back|Set Trans/ Back|Set TTI/Back|Move to Tray/Back", IniRead($ini, "Action", "Double-Click", "do Nothing"))
    _EnableDoubleClick()
    $Checkbox7 = GUICtrlCreateCheckbox("Sort Systray-Icons", 280, 229, 165)
    GUICtrlSetState($Checkbox7, IniRead($ini, "Settings", "Sort Systray-Icons", "4"))
    GUICtrlSetOnEvent($Checkbox7, "_EnableSystraySort")
    $Combo3 = GUICtrlCreateCombo("", 310, 249, 150)
    GUICtrlSetData($Combo3, "by Title|by Process|Ascending|Descending", "by Title")
    _EnableSystraySort()

    _GUICtrlTab_DeleteItem($PageControl1, 2)

    If IniRead($ini, "Settings", "Show Window on Start", "4") = 1 Then
    WinSetTrans($Title, "", 200)
    WinSetOnTop($Title,'',1)
    GUISetState(@SW_SHOW)
    Else
    WinSetTrans($Title, "", 0)
    GUISetState(@SW_SHOW)
    WinSetState($Title, "", @SW_HIDE)
    WinSetTrans($Title, "", 200)
    WinSetOnTop($Title,'',1)
    EndIf

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")


    $DoNotEndScript = True
    $DoNotEndScript2 = True
    $DoNotEndScript3 = True

    _EndScript()
    _UpdateListView()

    If Not FileExists($ini) Then
    _StandardSettings()
    _ApplySettings()
    EndIf

    If IniRead($ini, "Settings", "Sort Systray-Icons", "4") = 1 Then _SortSysTray()

    While 1
    Sleep(10)
    If _IsPressed("1B") Or _IsPressed("70") Then
    $WinGetState = WinGetState($Title)
    If _IsPressed("1B") And $WinGetState = 15 or $WinGetState = 31 Then
    _ToogleMain()
    ElseIf _IsPressed("70") And $WinGetState = 15 Then
    _Help()
    EndIf
    EndIf
    WEnd

    ;-----------------------------------------------------------------------------
    ; Update Listview
    ;-----------------------------------------------------------------------------

    Func _UpdateListView()
    _GUICtrlListView_DeleteAllItems($ListView1)
    $WinList = WinList()
    For $i = 1 to $WinList[0][0]
    If Not @error Then
    If $WinList[$i][0] <> "" AND IsVisible($WinList[$i][1]) Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinList[$i][0]))
    $WinGetHandle = WinGetHandle($WinList[$i][0])
    If $ProcessName = @ScriptName Then
    Else
    _GUICtrlListView_AddItem($ListView1, $ProcessName)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $WinList[$i][0], 1)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $WinGetHandle, 7)
    $WinIsOnTp = _WinIsOnTop($WinGetHandle)
    If $WinIsOnTp = True Then _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " x", 2)
    ;Tray - Missing
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If $Transparency <> -1 Then
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " " & $Transparency, 6)
    Else
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, "", 6)
    EndIf
    EndIf
    EndIf
    EndIf
    Next
    $SectionName = IniReadSectionNames($iniHide)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniHide, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    _GUICtrlListView_AddItem($ListView1, $SectionName[$i])
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $Section[$ii][0], 1)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $WinGetHandle, 7)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " x", 4)
    $WinIsOnTp = _WinIsOnTop($WinGetHandle)
    If $WinIsOnTp = True Then _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " x", 2)
    ;Tray - Missing
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If $Transparency <> -1 Then
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " " & $Transparency, 6)
    Else
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, "", 6)
    EndIf
    Next
    EndIf
    Next
    EndIf
    $SectionName = IniReadSectionNames($iniTTI)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniTTI, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    _GUICtrlListView_AddItem($ListView1, $SectionName[$i])
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $Section[$ii][0], 1)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, $WinGetHandle, 7)
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " x", 4)
    $WinIsOnTp = _WinIsOnTop($WinGetHandle)
    If $WinIsOnTp = True Then _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " x", 2)
    ;Tray - Missing
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If $Transparency <> -1 Then
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, " " & $Transparency, 6)
    Else
    _GUICtrlListView_AddSubItem($ListView1, _GUICtrlListView_GetItemCount($ListView1) - 1, "", 6)
    EndIf
    Next
    EndIf
    Next
    EndIf
    If IniRead($ini, "Settings", "Enable automatic Sort", "4") = 1 Then
    If $HowToSort = "" Then $HowToSort = IniRead($ini, "Sort", "Method", "don´t Sort")
    If $HowToSort = "DESCENDING" Then
    Global $B_DESCENDING[_GUICtrlListView_GetColumnCount ($ListView1) ]
    _GUICtrlListView_SimpleSort ($ListView1, $B_DESCENDING, DllStructGetData($tInfo, "SubItem"))
    _GUICtrlListView_SimpleSort ($ListView1, $B_DESCENDING, DllStructGetData($tInfo, "SubItem"))
    ElseIf $HowToSort = "ASCENDING" Then
    Global $B_ASCENDING[_GUICtrlListView_GetColumnCount ($ListView1) ]
    _GUICtrlListView_SimpleSort ($ListView1, $B_ASCENDING, DllStructGetData($tInfo, "SubItem"))
    Else
    EndIf
    EndIf
    EndFunc

    ;-----------------------------------------------------------------------------
    ; GUICtrlSetOnEvent
    ;-----------------------------------------------------------------------------

    ;EndFunc
    Func _EndScript()
    If $DoNotEndScript = False Then WinSetState($TiTle, "", @sw_hide)
    ;ReMove
    $SectionName = IniReadSectionNames($iniMove)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniMove, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    $Value = IniRead($iniMove, $SectionName[$i], $Section[$ii][0], "")
    $Split = StringSplit($Value, "|")
    If Not @error Then
    $WinGetPos = WinGetPos($WinGetHandle)
    If Not @error Then
    If $WinGetPos[0] = $Split[1] And $WinGetPos[1] = $Split[2] And $WinGetPos[2] = $Split[3] And $WinGetPos[3] = $Split[4] Then
    Else
    WinMove($WinGetHandle, "", $Split[1], $Split[2], $Split[3], $Split[4])
    EndIf
    EndIf
    EndIf
    Next
    EndIf
    Next
    EndIf
    ;ReTrans
    $SectionName = IniReadSectionNames($iniTrans)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniTrans, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    $Value = IniRead($iniTrans, $SectionName[$i], $Section[$ii][0], "255")
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If $Value <> $Transparency Then WinSetTrans($WinGetHandle, "", $value)
    Next
    EndIf
    Next
    EndIf
    ;ReOnTop
    $SectionName = IniReadSectionNames($iniTop)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniTop, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    $Value = IniRead($iniTop, $SectionName[$i], $Section[$ii][0], "False")
    $WinIsOnTop = _WinIsOnTop($WinGetHandle)
    If $Value <> $WinIsOnTop Then
    If $Value = "False" Then
    WinSetOnTop($WinGetHandle, "", 0)
    WinSetState($WinGetHandle, "", @SW_MINIMIZE)
    Else
    WinSetOnTop($WinGetHandle, "", 1)
    EndIf
    EndIf
    IniDelete($iniTop, $SectionName[$i], $Section[$ii][0])
    Next
    EndIf
    Next
    EndIf
    ;ReHide
    _AllWindowHideBack()
    ;ReImmunization
    _AllWindowTransNoClickBack()
    FileDelete($iniTop)
    FileDelete($iniTray)
    FileDelete($iniHide)
    FileDelete($iniTTI)
    FileDelete($iniTrans)
    FileDelete($iniMove)
    If $DoNotEndScript = False Then
    IniDelete($ini, "WRiTeR", "Notes")
    IniWrite($ini, "WRiTeR", "Notes", StringReplace(_GUICtrlEdit_GetText($Edit1), @CRLF, "[CRLF]"))
    DllClose($dll)
    Exit
    Else
    _ApplySettings()
    $DoNotEndScript = False
    EndIf
    EndFunc

    Func _OnExitFunc()
    _EndScript()
    ;~ If @exitMethod = 3 Or @exitMethod = 4 Then
    ;~ IniDelete($ini, "WRiTeR", "Notes")
    ;~ IniWrite($ini, "WRiTeR", "Notes", StringReplace(_GUICtrlEdit_GetText($Edit1), @CRLF, "[CRLF]"))
    ;~ EndIf
    EndFunc

    ;show/hide main
    Func _ToogleMain()
    $State = WinGetState($Title)
    If $State = 15 Or $State = 7 Then
    WinSetState($Title, "", @SW_HIDE)
    ElseIf $State = 23 Then
    _UpdateListView()
    WinSetState($Title, "", @SW_SHOW)
    WinActivate($Title)
    Else
    _UpdateListView()
    WinSetState($Title, "", @SW_SHOW)
    WinActivate($Title)
    EndIf
    EndFunc

    Func _MinMain()
    WinSetState($Title, "", @SW_HIDE)
    EndFunc

    ;show/hide tray-icon
    Func _ToogleTray()
    Opt("TrayIconHide", Not Opt("TrayIconHide", "Default"))
    If $ToogleTray = 0 Then
    GUICtrlSetState($Menu1_1, $GUI_Checked)
    $ToogleTray = 1
    ElseIf $ToogleTray = 1 Then
    GUICtrlSetState($Menu1_1, $GUI_UnChecked)
    $ToogleTray = 0
    EndIf
    EndFunc

    ;show Tab1
    Func _TrayLClick()
    $WinGetState = WinGetState($Title)
    If $WinGetState = 15 Or $WinGetState = 7 Then
    If _GUICtrlTab_GetCurSel($PageControl1) = 0 Then
    $SetTab = $TabSheet2
    ElseIf _GUICtrlTab_GetCurSel($PageControl1) = 1 Then
    $SetTab = $TabSheet1
    Else
    $SetTab = $TabSheet1
    EndIf
    GUICtrlSetState($SetTab, $GUI_SHOW)
    Else
    _ToogleMain()
    EndIf
    EndFunc

    ;Settings
    Func _Settings()
    $GetItemState = _GUICtrlMenu_GetItemState(_GUICtrlMenu_GetItemSubMenu (_GUICtrlMenu_GetMenu (WinGetHandle($Title)), 0), 3)
    If $GetItemState = 0 Then
    GUICtrlSetState($Menu1_3, $GUI_Checked)
    $TabSheet3 = GUICtrlCreateTabItem("Settings")
    ;GUICtrlSetState($TabSheet3, $GUI_SHOW)
    Else
    GUICtrlSetState($Menu1_3, $GUI_UnChecked)
    _GUICtrlTab_DeleteItem($PageControl1, 2)
    GUICtrlSetState($TabSheet1, $GUI_SHOW)
    EndIf
    EndFunc

    ;show Help
    Func _Help()
    SplashTextOn("Help", "Hilfe:" & @CRLF & @CRLF & _
    "Programm Funktionen: " & @CRLF & _
    @TAB & "* [ESC] minimiert Programm" & @CRLF & _
    @TAB & "* anzeigen/ verstecken des Programms bei Klick auf Tray-Symbol oder [ALT + ESC]" & @CRLF & _
    @TAB & "* anzeigen/ verstecken des WRiTeR-Tabs über [ALT Gr + P]" & @CRLF & _
    @TAB & "* anzeigen/ verstecken der Einstellungen über das Menü" & @CRLF & _
    @TAB & "* anzeigen/ verstecken des Tray-Symbols per Menü oder HotKey [ALT Gr + M]" & @CRLF & _
    @TAB & "* Rechtsklick auf Tray-Symbol zeigt Menü an" & @CRLF & _
    @TAB & "* Linksklick zeigt Fenster an und/ oder wechselt zwischen den Tabs (Windows + WRiTeR)" & @CRLF & _
    @TAB & "* an/ ausschalten der HotKeys per Menü oder HotKey [ALT Gr + Space] - dieser HotKey bleibt immer aktiviert" & @CRLF & _
    @TAB & "* Auswahl im Tray-Menü für Anzeige des GUIs in welcher Ecke" & @CRLF & _
    @TAB & "* WRiTeR: Edit-Feld, um schnell Informationen aufzuschreiben. Eingaben werden nach dem Schließen speichert und beim Start wieder zur Verfügung gestellt" & @CRLF & @CRLF & _
    "Einstellungen:" & @CRLF & _
    @TAB & "* Autostart mit Windows" & @CRLF & _
    @TAB & "* Anzeige des Tray-Symbols beim Start" & @CRLF & _
    @TAB & "* HotKey-Aktivierung beim Start des Programms" & @CRLF & _
    @TAB & '* automatisches Update der "Window-Liste"' & @CRLF & _
    @TAB & '* automatisches Sortieren der "Window-Liste"' & @CRLF & _
    @TAB & '* Aktion bei Doppelklick auf Eintrag in der "Window-Liste"' & @CRLF & _
    @TAB & "* Start des Programms in beborzugter Ecke" & @CRLF & _
    @TAB & '* voreingestellte Transparenz für "Trans-" und "TTI-Funktion"' & @CRLF & @CRLF & _
    "Expolorer Funktionen:" & @CRLF & _
    @TAB & "* aufrufen 2 Explorer-Fenster per HotKey (vertikal [F11] oder horizontal [ALT + F11]) oder Menü möglich" & @CRLF & _
    @TAB & '* anzeigen/ verstecken der "versteckten Dateien" per HotKey [ALT Gr + S] oder Menü möglich' & @CRLF & @CRLF & _
    "Hauptfunktionen:" & @CRLF & _
    @TAB & " jedes Sichtbare Fenster kann..." & @CRLF & _
    @TAB & '* "On Top" gesetzt werden + "On Top"-Attribut zurücknehmen (per Button oder HotKey [F9])' & @CRLF & _
    @TAB & "* Transparent gesetzt werden + Transparenz zurücknehmen (per Button oder HotKey [F10], oder Transparenz durch [ALT + Bild hoch/runter] erhöhen oder verringern" & @CRLF & _
    @TAB & "* versteckt werden + wieder sichtbar (per Button oder HotKey [F7] zum verstecken, [ALT + F7] zum zurücksetzen ALLER versteckten Fenster)" & @CRLF & _
    @TAB & '* sichtbar, "On Top", Transparent und durchklickbar gesetzt werden + zurück (per Button oder HotKey [ALT Gr + Einfg], [ALT + Einfg] setzt die Attribute aller Fenster zurück)' & @CRLF & _
    @TAB & "* halbiert und an einen beliebigen Bildschirmrand verschoben werden ([ALT + UP/DOWN/RIGHT/LEFT])" & @CRLF & _
    @TAB & "* maximiert werden [ALT Gr + F9]" & @CRLF & @CRLF & _
    "alle Einstellungen die Fenster betreffen, die durch das Programm getroffen werden, werden beim Beenden wieder zurückgesetzt", 860, 500, -1, -1, 0 + 1 + 4 + 32, "", 8)

    While 1
    Sleep(100)
    If _IsPressed("1B") Then
    SplashOff()
    ;WinSetState($Title, "", @SW_SHOWNA)
    ExitLoop
    EndIf
    WEnd
    EndFunc

    ;show About
    Func _About()
    WinSetOnTop($Title, "", 0)
    $MsgBox = MsgBox(64, "About", "by sc4ry" & @crlf & " ---IFK2005--- ")
    WinSetOnTop($Title, "", 1)
    EndFunc

    Func _HotKeySet()
    If $HotKeySet = True Then
    HotKeySet("{F9}")
    HotKeySet("{F10}")
    HotKeySet("{F7}")
    HotKeySet("^!{F7}")
    HotKeySet("{F8}")
    HotKeySet("^!{F8}")
    HotKeySet("!^{INS}")
    HotKeySet("!{INS}")
    HotKeySet("!{PGUP}")
    HotKeySet("!{PGDN}")
    HotKeySet("!{UP}")
    HotKeySet("!{DOWN}")
    HotKeySet("!{LEFT}")
    HotKeySet("!{RIGHT}")
    HotKeySet("!^{F9}")
    HotKeySet("{F11}")
    HotKeySet("!{F11}")
    HotKeySet("!^s")
    $HotKeySet = False
    GUICtrlSetState($Menu1_2, $GUI_Unchecked)
    TrayItemSetState($TrayItem6, $GUI_Unchecked)
    Else
    HotKeySet("{F9}","_HKToggleTop") ;set active window on top or back
    HotKeySet("{F10}", "_HKToogleTrans") ;set trans to window or back
    HotKeySet("{F7}", "_HKWindowHide") ;hide window
    HotKeySet("^!{F7}", "_AllWindowHideBack") ;set hide back on all windows
    HotKeySet("{F8}", "_HKWindowTray") ;hide window to tray
    HotKeySet("^!{F8}", "_AllWindowTrayBack") ;set hide to tray back on all windows
    HotKeySet("!^{INS}", "_HKWindowTransNoClick") ;set immun to window
    HotKeySet("!{INS}", "_AllWindowTransNoClickBack") ;set immun back on all windows
    HotKeySet("!{PGUP}", "_TransPlus") ;set window-trans +10
    HotKeySet("!{PGDN}", "_TransMinus") ;set window-trans -10
    HotKeySet("!{UP}", "_HKMoveWindowUP") ;move active window to top
    HotKeySet("!{DOWN}", "_HKMoveWindowDOWN") ;move active window to bottom
    HotKeySet("!{LEFT}", "_HKMoveWindowLEFT") ;move active window to left
    HotKeySet("!{RIGHT}", "_HKMoveWindowRIGHT") ;move active window to right
    HotKeySet("!^{F9}", "_HKMoveWindowMax") ;maximize active window
    HotKeySet("{F11}","_ExploreVertical") ;show 2 vertical explorer windows
    HotKeySet("!{F11}","_ExploreHorizontal") ;show 2 horizontal explorer windows
    HotKeySet("!^s","_ToogleHiddenFiles") ;show/hide hidden files
    $HotKeySet = True
    GUICtrlSetState($Menu1_2, $GUI_checked)
    TrayItemSetState($TrayItem6, $GUI_checked)
    EndIf
    EndFunc

    Func _EnableUpdate()
    If GUICtrlRead($Checkbox4) = 1 Then
    GUICtrlSetState($Input1, $GUI_ENABLE)
    Else
    GUICtrlSetState($Input1, $GUI_DISABLE)
    EndIf
    EndFunc

    Func _EnableSort()
    If GUICtrlRead($Checkbox5) = 1 Then
    GUICtrlSetState($Combo1, $GUI_ENABLE)
    Else
    GUICtrlSetState($Combo1, $GUI_DISABLE)
    EndIf
    EndFunc

    Func _EnableDoubleClick()
    If GUICtrlRead($Checkbox6) = 1 Then
    GUICtrlSetState($Combo2, $GUI_ENABLE)
    Else
    GUICtrlSetState($Combo2, $GUI_DISABLE)
    EndIf
    EndFunc

    Func _EnableSystraySort()
    If GUICtrlRead($Checkbox7) = 1 Then
    GUICtrlSetState($Combo3, $GUI_ENABLE)
    Else
    GUICtrlSetState($Combo3, $GUI_DISABLE)
    EndIf
    EndFunc

    Func _SortSysTray()
    FileInstall("SortSysTray.exe", "SortSysTray.exe")
    If GUICtrlRead($Checkbox7) = 1 Then
    If GUICtrlRead($Combo3) = "by Title" Then
    ShellExecute(@scriptdir & "\SortSysTray.exe", "/title", @scriptdir)
    ElseIf GUICtrlRead($Combo3) = "by Process" Then
    ShellExecute(@scriptdir & "\SortSysTray.exe", "/proc", @scriptdir)
    ElseIf GUICtrlRead($Combo3) = "Ascending" Then
    ShellExecute(@scriptdir & "\SortSysTray.exe", "/up", @scriptdir)
    ElseIf GUICtrlRead($Combo3) = "Descending" Then
    ShellExecute(@scriptdir & "\SortSysTray.exe", "/down", @scriptdir)
    Else
    EndIf
    EndIf
    ;~ FileDelete(@ScriptDir & "\SysTraySort.exe")
    EndFunc

    Func _StandardSettings()
    GUICtrlSetState($Radio4, 1)
    GUICtrlSetData($SSlider1, 200)
    GUICtrlSetData($SSlider2, 50)
    GUICtrlSetState($Checkbox1, 4)
    GUICtrlSetState($Checkbox2, 1)
    GUICtrlSetState($Checkbox3, 1)
    GUICtrlSetState($Checkbox3a, 4)
    GUICtrlSetState($Checkbox4, 4)
    GUICtrlSetData($Input1, 10)
    GUICtrlSetState($Input1, $GUI_DISABLE)
    GUICtrlSetState($Checkbox5, 4)
    GUICtrlSetData($Combo1, "")
    GUICtrlSetData($Combo1, "don´t Sort|Ascending|Descending", "don´t Sort")
    GUICtrlSetState($Combo1, $GUI_DISABLE)
    GUICtrlSetState($Checkbox6, 4)
    GUICtrlSetData($Combo2, "")
    GUICtrlSetData($Combo2, "do Nothing|Show/Hide Window|Set on Top/Back|Set Trans/ Back|Set TTI/Back|Move to Tray/Back", "do Nothing")
    GUICtrlSetState($Combo2, $GUI_DISABLE)
    GUICtrlSetState($Checkbox7, 4)
    GUICtrlSetData($Combo3, "")
    GUICtrlSetData($Combo3, "by Title|by Process|Ascending|Descending", "by Title")
    GUICtrlSetState($Combo3, $GUI_DISABLE)
    EndFunc

    Func _ApplySettings()
    If GUICtrlRead($Radio1) = 1 Then
    IniWrite($ini, "Position", "Corner", "1")
    WinMove($Title, '', 0, 0)
    TrayItemSetState($TrayItem1, 1)
    TrayItemSetState($TrayItem2, 4)
    TrayItemSetState($TrayItem3, 4)
    TrayItemSetState($TrayItem4, 4)
    TrayItemSetState($TrayItem5, 4)
    ElseIf GUICtrlRead($Radio2) = 1 Then
    IniWrite($ini, "Position", "Corner", "2")
    WinMove($Title, '', @DesktopWidth - 515, 0)
    TrayItemSetState($TrayItem1, 4)
    TrayItemSetState($TrayItem2, 1)
    TrayItemSetState($TrayItem3, 4)
    TrayItemSetState($TrayItem4, 4)
    TrayItemSetState($TrayItem5, 4)
    ElseIf GUICtrlRead($Radio3) = 1 Then
    IniWrite($ini, "Position", "Corner", "3")
    WinMove($Title, '', (@DesktopWidth / 2) - (515 / 2), (@DesktopHeight / 2) - (350 / 2))
    TrayItemSetState($TrayItem1, 4)
    TrayItemSetState($TrayItem2, 4)
    TrayItemSetState($TrayItem3, 1)
    TrayItemSetState($TrayItem4, 4)
    TrayItemSetState($TrayItem5, 4)
    ElseIf GUICtrlRead($Radio4) = 1 Then
    IniWrite($ini, "Position", "Corner", "4")
    WinMove($Title, '', @DesktopWidth - 515, @DesktopHeight - 350)
    TrayItemSetState($TrayItem1, 4)
    TrayItemSetState($TrayItem2, 4)
    TrayItemSetState($TrayItem3, 4)
    TrayItemSetState($TrayItem4, 1)
    TrayItemSetState($TrayItem5, 4)
    ElseIf GUICtrlRead($Radio5) = 1 Then
    IniWrite($ini, "Position", "Corner", "5")
    WinMove($Title, '', 0, @DesktopHeight - 350)
    TrayItemSetState($TrayItem1, 4)
    TrayItemSetState($TrayItem2, 4)
    TrayItemSetState($TrayItem3, 4)
    TrayItemSetState($TrayItem4, 4)
    TrayItemSetState($TrayItem5, 1)
    EndIf
    IniWrite($ini, "Transparence", "Trans", GUICtrlRead($SSlider1))
    IniWrite($ini, "Transparence", "TTI", GUICtrlRead($SSlider2))
    IniWrite($ini, "Settings", "Run with Windows", GUICtrlRead($Checkbox1))
    If GUICtrlRead($Checkbox1) = 1 Then
    RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Run\", $Title, "REG_SZ", @AutoItExe)
    Else
    RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run\", $Title)
    EndIf
    IniWrite($ini, "Settings", "Show Tray-Icon on Start", GUICtrlRead($Checkbox2))
    IniWrite($ini, "Settings", "Enable Hotkeys on Start", GUICtrlRead($Checkbox3))
    IniWrite($ini, "Settings", "Show Window on Start", GUICtrlRead($Checkbox3a))
    IniWrite($ini, "Settings", "Update Window List", GUICtrlRead($Checkbox4))
    IniWrite($ini, "Update Window List", "every Sec.", GUICtrlRead($Input1))
    If GUICtrlRead($Checkbox4) = 1 Then
    AdlibEnable("_UpdateListView", GUICtrlRead($Input1) * 1000)
    Else
    AdlibDisable( )
    EndIf
    IniWrite($ini, "Settings", "Enable automatic Sort", GUICtrlRead($Checkbox5))
    IniWrite($ini, "Sort", "Method", GUICtrlRead($Combo1))
    If GUICtrlRead($Checkbox5) = 1 Then
    $HowToSort = GUICtrlRead($Combo1)
    Else
    $HowToSort = "don´t Sort"
    EndIf
    IniWrite($ini, "Settings", "Action for double-click on Item", GUICtrlRead($Checkbox6))
    IniWrite($ini, "Action", "Double-Click", GUICtrlRead($Combo2))
    If GUICtrlRead($Checkbox6) = 1 Then
    $DoubleAction = GUICtrlRead($Combo2)
    Else
    $DoubleAction = "do Nothing"
    EndIf
    IniWrite($ini, "Settings", "Sort Systray-Icons", GUICtrlRead($Checkbox7))
    IniWrite($ini, "Systray", "Sort", GUICtrlRead($Combo3))
    If GUICtrlRead($Checkbox7) = 1 Then
    $SystrayAction = GUICtrlRead($Combo3)
    Else
    $SystrayAction = "by Title"
    EndIf
    EndFunc

    ;-----------------------------------------------------------------------------
    ;Button Funcs
    ;-----------------------------------------------------------------------------

    Func _BToogleTop()
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _ToggleTop($Window)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    _UpdateListView()
    EndFunc

    Func _BWindowTray()
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _WindowTray($Window)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    _UpdateListView()
    EndFunc

    Func _BWindowHide()
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _WindowHide($Window)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    _UpdateListView()
    EndFunc

    Func _BWindowTransNoClick()
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _WindowTransNoClick($Window)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    _UpdateListView()
    EndFunc

    Func _BToogleTrans()
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _ToogleTrans($Window)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    _UpdateListView()
    EndFunc

    Func _BMoveWindowLeft()
    $Position = "Left"
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _MoveWindow($Window, $Position)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    EndFunc

    Func _BMoveWindowUp()
    $Position = "Up"
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _MoveWindow($Window, $Position)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    EndFunc

    Func _BMoveWindowDown()
    $Position = "Down"
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _MoveWindow($Window, $Position)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    EndFunc

    Func _BMoveWindowRight()
    $Position = "Right"
    For $i = 1 To _GUICtrlListView_GetItemCount($ListView1)
    $LV_Checked = _GUICtrlListView_GetItemChecked($ListView1, $i - 1)
    If $LV_Checked = True Then
    $Window = _GUICtrlListView_GetItemText($ListView1, $i - 1, 7)
    _MoveWindow($Window, $Position)
    _GUICtrlListView_SetItemChecked($ListView1, $i - 1, False)
    EndIf
    Next
    EndFunc

    ;-----------------------------------------------------------------------------
    ;Hotkey Funcs
    ;-----------------------------------------------------------------------------

    Func _ToogleWRiTeR()
    $State = WinGetState($Title)
    If $State = 15 Or $State = 7 Then
    WinSetState($Title, "", @SW_HIDE)
    ElseIf $State = 23 Then
    GUICtrlSetState($TabSheet2, $GUI_SHOW)
    WinSetState($Title, "", @SW_SHOW)
    WinActivate($Title)
    ControlClick($Title, "", "[Class:Edit;Instance:1]")
    Else
    GUICtrlSetState($TabSheet2, $GUI_SHOW)
    WinSetState($Title, "", @SW_SHOW)
    WinActivate($Title)
    ControlClick($Title, "", "[Class:Edit;Instance:1]")
    EndIf
    EndFunc

    Func _HKToggleTop()
    $Window = ''
    _ToggleTop($Window)
    _UpdateListView()
    EndFunc

    Func _HKToogleTrans()
    $Window = ''
    _ToogleTrans($Window)
    _UpdateListView()
    EndFunc

    Func _HKWindowHide()
    $Window = ''
    _WindowHide($Window)
    _UpdateListView()
    EndFunc

    Func _HKWindowTray()
    $Window = ''
    _WindowTray($Window)
    _UpdateListView()
    EndFunc

    Func _HKWindowTransNoClick()
    $Window = ''
    _WindowTransNoClick($Window)
    _UpdateListView()
    EndFunc

    ;-----------------------------------------------------------------------------
    ;Tray Funcs
    ;-----------------------------------------------------------------------------

    Func _TrayLeftTop()
    WinMove($Title, '', 0, 0)
    EndFunc

    Func _TrayRightTop()
    WinMove($Title, '', @DesktopWidth - 515, 0)
    EndFunc

    Func _TrayCenter()
    WinMove($Title, '', (@DesktopWidth / 2) - (515 / 2), (@DesktopHeight / 2) - (350 / 2))
    EndFunc

    Func _TrayRightBottom()
    WinMove($Title, '', @DesktopWidth - 515, @DesktopHeight - 350)
    EndFunc

    Func _TrayLeftBottom()
    WinMove($Title, '', 0, @DesktopHeight - 350)
    EndFunc

    Func _TrayOpen()
    _UpdateListView()
    WinSetState($Title, "", @sw_show)
    EndFunc

    Func _TrayExit()
    _EndScript()
    EndFunc

    ;-----------------------------------------------------------------------------
    ;Window Funcs
    ;-----------------------------------------------------------------------------

    ;more Transparency
    Func _TransPlus()
    $WinGetHandle = WinGetHandle("")
    $WinGetTitle = WinGetTitle("")
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If IniRead($iniTrans, $ProcessName, $WinGetTitle, "") = "" Then IniWrite($iniTrans, $ProcessName, $WinGetTitle, $Transparency)
    If $Transparency = -1 or $Transparency = 255 Or $Transparency + 10 > 255 Then
    WinSetTrans($WinGetHandle, '', 255)
    Else
    WinSetTrans($WinGetHandle, '', $Transparency + 10)
    EndIf
    _UpdateListView()
    EndFunc

    ;less Transparency
    Func _TransMinus()
    $WinGetHandle = WinGetHandle("")
    $WinGetTitle = WinGetTitle("")
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If IniRead($iniTrans, $ProcessName, $WinGetTitle, "") = "" Then IniWrite($iniTrans, $ProcessName, $WinGetTitle, $Transparency)
    If $Transparency = -1 or $Transparency = 255 Then
    WinSetTrans($WinGetHandle, '', 255 - 10)
    ElseIf $Transparency - 10 > 0 then
    WinSetTrans($WinGetHandle, '', $Transparency - 10)
    Else
    WinSetTrans($WinGetHandle, '', 10)
    EndIf
    _UpdateListView()
    EndFunc

    ;sets fix trans to window
    Func _ToogleTrans($Window)
    $WinGetHandle = WinGetHandle($Window)
    $WinGetTitle = WinGetTitle($Window)
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    _API_GetLayeredWindowAttributes($WinGetHandle,$i_transcolor,$Transparency)
    If IniRead($iniTrans, $ProcessName, $WinGetTitle, "") = "" Then IniWrite($iniTrans, $ProcessName, $WinGetTitle, $Transparency)
    If $Transparency = GUICtrlRead($Slider1) Then
    WinSetTrans($WinGetHandle,'', 255)
    Else
    WinSetTrans($WinGetHandle,'', GUICtrlRead($Slider1))
    EndIf
    EndFunc

    ;immunize window
    Func _WindowTransNoClick($Window)
    $WinGetTitle = WinGetTitle($Window)
    $WinGetHandle = WinGetHandle($Window)
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    $Value = IniRead($iniTTI, $ProcessName, $WinGetTitle, "")
    If $Value = "" Then
    _Win_SetClickThrough($WinGetHandle)
    IniWrite($iniTTI, $ProcessName, $WinGetTitle, "x")
    Else
    _Win_SetClickThrough($WinGetHandle, "", False)
    WinSetOnTop($WinGetTitle, "", 0)
    WinSetTrans($WinGetTitle, "", 255)
    IniDelete($iniTTI, $ProcessName, $WinGetTitle)
    EndIf
    EndIf
    EndFunc

    ;hide window
    Func _WindowHide($Window)
    $WinGetHandle = WinGetHandle($Window)
    $WinGetTitle = WinGetTitle($Window)
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniHide, $ProcessName, $WinGetTitle, "") = "" Then
    ;~ If Not $WinGetTitle = "" And $WinGetTitle <> "Startmenü" And Not $WinGetTitle <> "Startmenu" Then
    WinSetState($WinGetHandle, "", @SW_HIDE)
    IniWrite($iniHide, $ProcessName, $WinGetTitle, "x")
    ;~ EndIf
    Else
    WinSetState($WinGetHandle, "", @SW_SHOW)
    IniDelete($iniHide, $ProcessName, $WinGetTitle)
    EndIf
    EndFunc

    ;toogle on top
    Func _ToggleTop($Window)
    $WinGetHandle = WinGetHandle($Window)
    $WinGetTitle = WinGetTitle($Window)
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    $WinIsOnTop = _WinIsOnTop($WinGetHandle)
    If IniRead($iniTop, $ProcessName, $WinGetTitle, "") = "" Then IniWrite($iniTop, $ProcessName, $WinGetTitle, $WinIsOnTop)
    If $WinIsOnTop = True Then
    WinSetOnTop($WinGetHandle, "", 0)
    Else
    WinSetOnTop($WinGetHandle, "", 1)
    EndIf
    WinSetOnTop($Form1_1, "", 1)
    EndFunc

    ;hide window to tray
    Func _WindowTray($Window)
    EndFunc

    ;;;;;;;;;;;;;;;;
    ;Set-Back Funcs
    ;;;;;;;;;;;;;;;;

    ;set hide to tray back on all windows
    Func _AllWindowTrayBack()
    _UpdateListView()
    EndFunc

    ;set immunization back
    Func _AllWindowTransNoClickBack()
    $SectionName = IniReadSectionNames($iniTTI)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniTTI, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    $Style = _WinAPI_GetWindowLong($WinGetHandle,$GWL_EXSTYLE)
    If BitAND($Style,$WS_EX_TRANSPARENT) = $WS_EX_TRANSPARENT And BitAND($Style,$WS_EX_LAYERED) = $WS_EX_LAYERED Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetHandle))
    If $ProcessName <> @ScriptName Then
    _Win_SetClickThrough($WinGetHandle, "", False)
    WinSetOnTop($WinGetHandle, "", 0)
    WinSetTrans($WinGetHandle, "", 255)
    If $Section[0][0] = 0 Or $Section[0][0] = 1 Then
    IniDelete($iniTTI, $ProcessName)
    Else
    IniDelete($iniTTI, $ProcessName, $Section[$ii][0])
    EndIf
    EndIf
    EndIf
    Next
    EndIf
    Next
    EndIf
    If $DoNotEndScript2 = False Then
    _UpdateListView()
    Else
    $DoNotEndScript2 = False
    EndIf
    EndFunc

    Func _AllWindowHideBack()
    $SectionName = IniReadSectionNames($iniHide)
    If Not @error Then
    For $i = 1 To $SectionName[0]
    $Section = IniReadSection($iniHide, $SectionName[$i])
    If Not @error Then
    For $ii = 1 To $Section[0][0]
    $WinGetHandle = WinGetHandle($Section[$ii][0])
    $Value = IniRead($iniHide, $SectionName[$i], $Section[$ii][0], "x")
    If $Value <> "" Then
    WinSetState($Section[$ii][0], "", @SW_SHOW)
    If $Section[0][0] = 0 Or $Section[0][0] = 1 Then
    IniDelete($iniTTI, $SectionName[$i])
    Else
    IniDelete($iniTTI, $SectionName[$i], $Section[$ii][0])
    EndIf
    Else
    WinSetState($WinGetHandle, "", @SW_HIDE)
    EndIf
    Next
    EndIf
    Next
    EndIf
    If $DoNotEndScript3 = False Then
    _UpdateListView()
    Else
    $DoNotEndScript3 = False
    EndIf
    EndFunc

    ;-----------------------------------------------------------------------------
    ;Explorer Funcs
    ;-----------------------------------------------------------------------------

    ;2 explorer windows vertical
    Func _ExploreVertical()
    $appHorizontal = False
    _Explore($appHorizontal)
    EndFunc

    ;2 explorer windows horizontal
    Func _ExploreHorizontal()
    $appHorizontal = True
    _Explore($appHorizontal)
    EndFunc

    ;create explorer windows
    Func _Explore($appHorizontal)
    Local $aSize[3][5] ; [0]=Handle, [1]=Breite, [2]=Höhe, [3]=x, [4]=y
    $aSize[0][1] = @DesktopWidth
    $aSize[0][2] = @DesktopHeight
    If $appHorizontal = True Then
    $aSize[1][1] = @DesktopWidth/2
    $aSize[2][1] = @DesktopWidth/2
    $aSize[1][2] = @DesktopHeight
    $aSize[2][2] = @DesktopHeight
    $aSize[1][3] = 0
    $aSize[2][3] = @DesktopWidth/2
    $aSize[1][4] = 0
    $aSize[2][4] = 0
    ElseIf $appHorizontal = False Then
    $aSize[1][1] = @DesktopWidth
    $aSize[2][1] = @DesktopWidth
    $aSize[1][2] = @DesktopHeight/2 + 12.5
    $aSize[2][2] = @DesktopHeight/2 + 12.5
    $aSize[1][3] = 0
    $aSize[2][3] = 0
    $aSize[1][4] = 0
    $aSize[2][4] = @DesktopHeight/2 - 12.5
    EndIf
    Run ('Explorer.exe /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', '', @SW_HIDE)
    WinWaitActive('Arbeitsplatz')
    $aSize[1][0] = WinGetHandle('Arbeitsplatz')
    WinMove($aSize[1][0], '', $aSize[1][3], $aSize[1][4], $aSize[1][1], $aSize[1][2] - 25)
    WinSetTitle('Arbeitsplatz', '', 'Arbeitsplatz_1')
    Run ('Explorer.exe /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', '', @SW_HIDE)
    WinWaitActive('Arbeitsplatz')
    $aSize[2][0] = WinGetHandle('Arbeitsplatz')
    WinMove($aSize[2][0], '', $aSize[2][3], $aSize[2][4], $aSize[2][1], $aSize[2][2] - 25)
    WinSetTitle('Arbeitsplatz', '', 'Arbeitsplatz_2')
    WinSetState($aSize[1][0], '', @SW_SHOW)
    WinSetState($aSize[2][0], '', @SW_SHOW)
    EndFunc

    ;show/hide hidden files
    Func _ToogleHiddenFiles()
    _changeFileVisible()
    EndFunc

    ;change RegKey for show/hide hidden files
    Func _changeFileVisible()
    $opt1 = Opt("WinTitleMatchMode", 4)
    $opt2 = Opt("MustDeclareVars", 1)
    Local $s_RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
    Local $i_State = RegRead($s_RegKey, "Hidden")
    If $i_State = 1 Then
    RegWrite($s_RegKey, "Hidden", "REG_DWORD", "2")
    GUICtrlSetState($Menu2_4, $GUI_UnChecked)
    Else
    RegWrite($s_RegKey, "Hidden", "REG_DWORD", "1")
    GUICtrlSetState($Menu2_4, $GUI_Checked)
    EndIf
    Opt("WinTitleMatchMode", $opt1 )
    Opt("MustDeclareVars", $opt2 )
    _refreshExplorer()
    EndFunc ;==>_changeFileVisible

    ;change explorer view to show/hide hidden files
    Func _refreshExplorer()
    $opt1 = Opt("WinTitleMatchMode", 4)
    $opt2 = Opt("MustDeclareVars", 1)
    Local $ah_WinList1 = WinList("classname=ExploreWClass")
    Local $ah_WinList2 = WinList("classname=CabinetWClass")
    Local $h_Desktop = WinGetHandle("classname=Progman")
    ;
    ; Aktualisieren der "ExploreWClass" Fenster
    If $ah_WinList1[0][0] > 0 Then
    ;_ArrayDisplay($ah_WinList1, "$ah_WinList1")
    For $i = 1 To $ah_WinList1[0][0] Step 1
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $ah_WinList1[$i][1], "int", 0x111, "int", 28931, "int", 0)
    Next
    EndIf
    ;
    ; Aktualisieren der "CabinetWClass" Fenster
    If $ah_WinList2[0][0] > 0 Then
    ;_ArrayDisplay($ah_WinList2, "$ah_WinList2")
    For $i = 1 To $ah_WinList1[0][0] Step 1
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $ah_WinList1[$i][1], "int", 0x111, "int", 28931, "int", 0)
    Next
    EndIf
    ;
    ; Aktualisieren des "Desktops"
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $h_Desktop, "int", 0x111, "int", 28931, "int", 0)
    Opt("WinTitleMatchMode", $opt1 )
    Opt("MustDeclareVars", $opt2 )
    EndFunc ;==>_refreshExplorer

    Func _HKMoveWindowUP()
    $Window = 'active'
    $Position = "Up"
    _MoveWindow($Window, $Position)
    EndFunc

    Func _HKMoveWindowDOWN()
    $Window = 'active'
    $Position = "Down"
    _MoveWindow($Window, $Position)
    EndFunc

    Func _HKMoveWindowLEFT()
    $Window = 'active'
    $Position = "Left"
    _MoveWindow($Window, $Position)
    EndFunc

    Func _HKMoveWindowRIGHT()
    $Window = 'active'
    $Position = "Right"
    _MoveWindow($Window, $Position)
    EndFunc

    Func _HKMoveWindowMax()
    $Window = 'active'
    $Position = "Max"
    _MoveWindow($Window, $Position)
    EndFunc

    ;moves window
    Func _MoveWindow($Window, $Position)
    ;MsgBox(0, "", $Window & @CRLF & $Position)
    Local $aSize[3][5] ; [0]=Handle, [1]=Breite, [2]=Höhe, [3]=x, [4]=y
    Local $a = Opt("WinTitleMatchMode", 4)
    Local $b = Opt("WinSearchChildren", 1)
    $aSize[0][1] = @DesktopWidth
    $aSize[0][2] = @DesktopHeight
    $WinGetTitle = WinGetTitle($Window)
    Switch $Position
    Case "Up"
    $aSize[1][1] = @DesktopWidth
    $aSize[2][1] = @DesktopWidth
    $aSize[1][2] = @DesktopHeight / 2
    $aSize[2][2] = @DesktopHeight / 2
    $aSize[1][3] = 0
    $aSize[2][3] = 0
    $aSize[1][4] = 0
    $aSize[2][4] = @DesktopHeight / 2
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniMove, $ProcessName, $WinGetTitle, "") = "" Then
    $WinPos = WinGetPos($WinGetTitle)
    If Not @error Then
    IniWrite($iniMove,$ProcessName, $WinGetTitle, $WinPos[0] & "|" & $WinPos[1] & "|" & $WinPos[2] & "|" & $WinPos[3])
    EndIf
    EndIf
    If BitAND(WinGetState($WinGetTitle), 32) = 32 Then WinSetState($WinGetTitle, '', @SW_RESTORE)
    WinMove($WinGetTitle, '', $aSize[1][3], $aSize[1][4], $aSize[1][1], $aSize[1][2])
    Else
    WinMove($WinGetTitle, '', 0, 0)
    EndIf
    Case "Down"
    $aSize[1][1] = @DesktopWidth
    $aSize[2][1] = @DesktopWidth
    $aSize[1][2] = @DesktopHeight / 2
    $aSize[2][2] = @DesktopHeight / 2
    $aSize[1][3] = 0
    $aSize[2][3] = 0
    $aSize[1][4] = $aSize[1][2]
    $aSize[2][4] = @DesktopHeight / 2
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniMove, $ProcessName, $WinGetTitle, "") = "" Then
    $WinPos = WinGetPos($WinGetTitle)
    If Not @error Then
    IniWrite($iniMove,$ProcessName, $WinGetTitle, $WinPos[0] & "|" & $WinPos[1] & "|" & $WinPos[2] & "|" & $WinPos[3])
    EndIf
    EndIf
    If BitAND(WinGetState($WinGetTitle), 32) = 32 Then WinSetState($WinGetTitle, '', @SW_RESTORE)
    WinMove($WinGetTitle, '', $aSize[1][3], $aSize[1][4], $aSize[1][1], $aSize[1][2] - 25)
    Else
    WinMove($WinGetTitle, '', @DesktopWidth - 515, @DesktopHeight - 350)
    EndIf
    Case "Left"
    $aSize[1][1] = @DesktopWidth / 2
    $aSize[2][1] = @DesktopWidth / 2
    $aSize[1][2] = @DesktopHeight
    $aSize[2][2] = @DesktopHeight
    $aSize[1][3] = 0
    $aSize[2][3] = @DesktopWidth / 2
    $aSize[1][4] = 0
    $aSize[2][4] = 0
    $WinGetTitle = WinGetTitle($Window)
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniMove, $ProcessName, $WinGetTitle, "") = "" Then
    $WinPos = WinGetPos($WinGetTitle)
    If Not @error Then
    IniWrite($iniMove,$ProcessName, $WinGetTitle, $WinPos[0] & "|" & $WinPos[1] & "|" & $WinPos[2] & "|" & $WinPos[3])
    EndIf
    EndIf
    If BitAND(WinGetState($WinGetTitle), 32) = 32 Then WinSetState($WinGetTitle, '', @SW_RESTORE)
    WinMove($WinGetTitle, '', $aSize[1][3], $aSize[1][4], $aSize[1][1], $aSize[1][2] - 25)
    Else
    WinMove($WinGetTitle, '', 0, @DesktopHeight - 350)
    EndIf
    Case "RIGHT"
    $aSize[1][1] = @DesktopWidth / 2
    $aSize[2][1] = @DesktopWidth / 2
    $aSize[1][2] = @DesktopHeight
    $aSize[2][2] = @DesktopHeight
    $aSize[1][3] = $aSize[1][1]
    $aSize[2][3] = @DesktopWidth / 2
    $aSize[1][4] = 0
    $aSize[2][4] = 0
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniMove, $ProcessName, $WinGetTitle, "") = "" Then
    $WinPos = WinGetPos($WinGetTitle)
    If Not @error Then
    IniWrite($iniMove,$ProcessName, $WinGetTitle, $WinPos[0] & "|" & $WinPos[1] & "|" & $WinPos[2] & "|" & $WinPos[3])
    EndIf
    EndIf
    If BitAND(WinGetState($WinGetTitle), 32) = 32 Then WinSetState($WinGetTitle, '', @SW_RESTORE)
    WinMove($WinGetTitle, '', $aSize[1][3], $aSize[1][4], $aSize[1][1], $aSize[1][2] - 25)
    Else
    WinMove($WinGetTitle, '', @DesktopWidth - 515, 0)
    EndIf
    Case "Max"
    If $WinGetTitle <> $Title Then
    $ProcessName = _ProcessGetName(WinGetProcess($WinGetTitle))
    If IniRead($iniMove, $ProcessName, $WinGetTitle, "") = "" Then
    $WinPos = WinGetPos($WinGetTitle)
    If Not @error Then
    IniWrite($iniMove,$ProcessName, $WinGetTitle, $WinPos[0] & "|" & $WinPos[1] & "|" & $WinPos[2] & "|" & $WinPos[3])
    EndIf
    EndIf
    WinSetState($WinGetTitle, '', @SW_MAXIMIZE)
    EndIf
    EndSwitch
    Opt("WinTitleMatchMode", $a)
    Opt("WinSearchChildren", $b)
    EndFunc ;==>_MoveWindow

    ;-----------------------------------------------------------------------------
    ;Extended Window Funcs
    ;-----------------------------------------------------------------------------

    ;check if window is visible
    Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
    Else
    Return 0
    EndIf
    EndFunc

    ;get transparency of a window
    Func _API_GetLayeredWindowAttributes($hwnd, ByRef $i_transcolor, ByRef $Transparency)
    $i_transcolor = -1
    $Transparency = -1
    Local Const $AC_SRC_ALPHA = 1
    Local Const $ULW_ALPHA = 2
    Local Const $LWA_ALPHA = 0x2
    Local Const $LWA_COLORKEY = 0x1
    Local $Ret = DllCall("user32.dll", "int", "GetLayeredWindowAttributes", "hwnd", $hwnd, "long*", $i_transcolor, "byte*", $Transparency, "long*",0)
    Select
    Case @error
    Return SetError(@error,0,0)
    Case $ret[0] = 0
    Return SetError(4,0,0)
    Case Else
    $i_transcolor = $ret[2]
    $Transparency = $ret[3]
    Return $ret[4]
    EndSelect
    EndFunc ; Author(s): Prog@ndy

    ;set window "immun"
    Func _Win_SetClickThrough($title,$text = "",$noclic = True)
    Local $hWnd = WinGetHandle($title,$text)
    If @error Then Return SetError(1,0,0)
    If $noclic Then
    _WinAPI_SetWindowLong($hWnd,$GWL_EXSTYLE,BitOR(_WinAPI_GetWindowLong($hWnd,$GWL_EXSTYLE),$WS_EX_TRANSPARENT))
    If @error Then Return SetError(2,0,0)
    WinSetTrans($hWnd,"",GUICtrlRead($SSlider2)) ; Sets the Layered Attribute, but still shows the window :)
    WinSetOnTop($hwnd, "", 1)
    If @error Then Return SetError(2,0,0)
    Else
    _WinAPI_SetWindowLong($hWnd,$GWL_EXSTYLE,BitAND(_WinAPI_GetWindowLong($hWnd,$GWL_EXSTYLE),BitNOT($WS_EX_TRANSPARENT)))
    If @error Then Return SetError(2,0,0)
    EndIf
    Return 1
    EndFunc ; Author(s): Prog@ndy

    ;check if win is "on top"
    Func _WinIsOnTop($WindowHandle)
    Local $long = _WinAPI_GetWindowLong(WinGetHandle($WindowHandle),$GWL_EXSTYLE)
    Return BitAND($long,8)=8 ; $WS_EX_TOPMOST = 8
    EndFunc ; Author(s): Prog@ndy

    ;checks double-click on listviewitem
    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
    $hWndListView = $ListView1
    If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1)

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
    Case $hWndListView
    Switch $iCode
    Case $LVN_COLUMNCLICK ; A column was clicked
    Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
    _GUICtrlListView_SimpleSort ($hWndListView, $B_DESCENDING, DllStructGetData($tInfo, "SubItem"))
    Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
    If IniRead($ini, "Settings", "Action for double-click on Item", "4") = 1 Then
    $DoubleAction = IniRead($ini, "Action", "Double-Click", "do Nothing")
    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
    $Window = _GUICtrlListView_GetItemText($hWndFrom, DllStructGetData($tInfo, "Index"), 1)
    ;#cs
    Select
    Case $DoubleAction = "do Nothing"
    Case $DoubleAction = "Show/Hide Window"
    _WindowHide($Window)
    _UpdateListView()
    Case $DoubleAction = "Set on Top/Back"
    _ToggleTop($Window)
    _UpdateListView()
    Case $DoubleAction = "Set Trans/ Back"
    _ToogleTrans($Window)
    _UpdateListView()
    Case $DoubleAction = "Set TTI/Back"
    _WindowTransNoClick($Window)
    _UpdateListView()
    Case $DoubleAction = "Move to Tray/Back"
    _WindowTray($Window)
    _UpdateListView()
    Case Else
    EndSelect
    ;#ce
    EndIf
    EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

  • Prob gelöst, neues update "19.06.08"

    erledigt, gefixt, geändert:

    [autoit]


    ; Gui anpassen
    ; Autoupdate der Liste -> beim öffnen des Fenster per Hotkey/Traymenü
    ; sortieren bei Spalten-Klick -> klappt
    ; Hotkeys per Menü de-/aktivierbar
    ; Tray-Menü -> erstellt
    ; Fenster anzeigen
    ; Exit
    ; Hotkey de-/aktivieren
    ; Fenster anzeigen in welcher Ecke
    ; Probleme
    ; Klick auf einige ListView-Einträge führen Funktionen aus -> gefixt
    ; Program Manager - Explorer Anzeige Fehlerhaft in Mainwindow? -> scheint i. O. zu sein
    ; F1-Hilfe nur wenn Fenster Fokus hat, Hilfe schließen ohne Fenster zu minimieren -> gefixt

    [/autoit]
  • Update 22.06.08

    neu, geändert, gefixt,...

    [autoit]

    ; Neu
    ; Problem: Hidden Windows sind nicht mehr in ListView -> gelöst
    ; Hotkey: Show/Hide only 4 WRiTeR
    ; About-Box
    ; Einstellmöglichkeiten
    ; autostart
    ; HotKeySet generell an-/ausschalten
    ; Ecke
    ; doppelklick-func
    ; automatisches updaten/ sortieren
    ; generelle Transparenz
    ; Transparenz für TTI
    ; nur 1 instanz erlaubt
    ; HotKeySet per hotkey ein/ausschalten
    ; Doppelklick in ListView

    [/autoit]
  • Könntet Ihr eventuell den Code nochmal Posten als [code-] [/code]
    Weil da sind einige Zeichen die sich rein geschlichen haben, und nicht als Code angenommen werden.

    Gruß remax

    p.s. Was macht das Ding genau?

    Einmal editiert, zuletzt von Remax (23. Juni 2008 um 08:38)

  • update 16.07.08

    leider wenig zeit zum updaten, da ich mir ne neue arbeit suchen muss, aber hier erstmal nen dicken bug beseitigt.

    wenn man mehrere fenster gleichzeit (im gui) bearbeiten wollte, wurde immer nur eins bearbeitet.
    das ganze tool schien träge. >Grund:

    nachdem das erste fenster "bearbeitet" wurde, wurde die liste neu aufgebaut, also alle haken entfernt.
    damit konnten die anderen fenster nicht mehr "bearbeitet" werden und das tool wurde durch die schleife extrem langsam.

    das ist jetzt gefixt =)

  • Sorry, wenn ich das wieder hoch hole, wo es 272 Tage geschlummert hat, aber schau dir mal taskbarshuffle und TrayIt an, vllt. bekommst du dann eine neue Inspiration ;)