[Beispiel] Slide GUI

  • Hey, hatte das hier für AutoIt.at geschrieben, und dachte mir, dass es auch hier nicht fehl am Platze wäre.

    Die Funktionen _SlideWin() und _WinIsHovered sind natürlich ohne anpassung übernehmbar.

    /EDIT: Daraus ist auch vor ewiger Zeit mal eine UDF enstanden:
    https://autoit.de/index.php?page=Thread&postID=145125

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <WindowsConstants.au3>
    HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
    $hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)

    [/autoit] [autoit][/autoit] [autoit]

    $h_Left = GUICreate("SlideGUI left", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    $_Button1 = GUICtrlCreateButton("Example Button", 40, 40, 100, 30)
    GUICtrlCreateEdit("Sample Edit...", 20, 90, 120, 200)
    $h_Right = GUICreate("SlideGUI Right", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateEdit("Sample Edit...", 20, 20, 150, 300)
    $h_Bottom = GUICreate("SlideGUI Bottom", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateCheckbox("Sample Checkbox", 40, 30)
    GUICtrlCreateCombo("Combo", 140, 50)
    $h_Top = GUICreate("SlideGUI Top", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    $_ListView = GUICtrlCreateListView("Columnd 1|Column 2", 5, 5, 340, 145)
    GUICtrlCreateListViewItem("Item 1_1|Item 1_2",$_ListView)
    GUICtrlCreateListViewItem("Item 2_1|Item 2_2",$_ListView)
    GUICtrlCreateListViewItem("Item 3_1|Item 3_2",$_ListView)

    [/autoit] [autoit][/autoit] [autoit]

    ; Move GUI's to the right place and set the Variables State to False
    Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
    _SlideWin($h_Left, "out", "left")
    _SlideWin($h_Right, "out", "right")
    _SlideWin($h_Bottom, "out", "bottom")
    _SlideWin($h_Top, "out", "top")

    [/autoit] [autoit][/autoit] [autoit]

    ; Show GUI's
    GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Top)

    [/autoit] [autoit][/autoit] [autoit]

    While 1 * Sleep(10)
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = -3
    _Exit()
    Case $nMsg[0] = $_Button1
    MsgBox(0, "", "Example Button clicked.")
    Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
    If Not $LEFT_IN Then ; If not already slide-in,
    _SlideWin($h_Left, "in", "left") ; Slide in GUI
    $LEFT_IN = True ; Set var to True.
    EndIf
    Case _WinIsHovered($h_Right, $hDLL)
    If Not $RIGHT_IN Then
    _SlideWin($h_Right, "in", "right")
    $RIGHT_IN = True
    EndIf
    Case _WinIsHovered($h_Bottom, $hDLL)
    If Not $BOTTOM_IN Then
    _SlideWin($h_Bottom, "in", "bottom")
    $BOTTOM_IN = True
    EndIf
    Case _WinIsHovered($h_Top, $hDLL)
    If Not $TOP_IN Then
    _SlideWin($h_Top, "in", "top")
    $TOP_IN = True
    EndIf
    Case Else ; No window is hovered. Check if we need to Slide out a GUI.
    Select
    Case $LEFT_IN
    _SlideWin($h_Left, "out", "left")
    $LEFT_IN = False
    Case $RIGHT_IN
    _SlideWin($h_Right, "out", "right")
    $RIGHT_IN = False
    Case $TOP_IN
    _SlideWin($h_Top, "out", "top")
    $TOP_IN = False
    Case $BOTTOM_IN
    _SlideWin($h_Bottom, "out", "bottom")
    $BOTTOM_IN = False
    EndSelect
    EndSelect
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _SlideWin($hWnd, $sMode, $sSide)
    ;$hWnd = Window to slide.
    ;$sMode = Slide-In or -out (in|out)
    ;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
    Local $aScreen_Res = WinGetPos(WinGetHandle("Program Manager"))
    Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
    Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")

    [/autoit] [autoit][/autoit] [autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    $aScreen_Res[0] - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    $aScreen_Res[1] - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit] [autoit][/autoit] [autoit]

    $aWPos = WinGetPos($hWnd)
    ; Slide GUI.
    Switch $sSide
    Case "left", "right"
    Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[0], $TO = $aWPos[0] _
    + (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
    - (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
    For $i = $aWPos[0] To $TO Step $STEP
    WinMove($hWnd, "", $i, $aWPos[1])
    Sleep(10)
    Next
    Case "top", "bottom"
    Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[1], $TO = $aWPos[1] _
    + (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
    - (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
    For $i = $aWPos[1] To $TO Step $STEP
    WinMove($hWnd, "", $aWPos[0], $i)
    Sleep(10)
    Next
    EndSwitch
    EndFunc ;==>_SlideWin

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinIsHovered($hWnd, $vDLL = "User32.dll")
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    $aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

    [/autoit] [autoit][/autoit] [autoit]

    Return $aResult[0] <> 0
    EndFunc ;==>_WinIsHovered

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($hDLL) ; Dont forget to close your DLL-Handle
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Ich wußte gar nicht, dass es Autoit.at gibt 8| . Wieviele Foren will FirePanther denn noch eröffnen?!

    Zu deinem Skript: Funktioniert tadellos! :thumbup:
    Da gibt es aber irgendwo bereits eine tolle UDF für sowas, weiß leider nur nicht mehr wo und von wem.

    Scheint sein neustes Projekt zu sein. Wie viele er schon eröffnet hat / eröffnen will, kann ich dir nicht sagen. Ich kenne nur autoit.at.

    Sehr schön, dass es funktioniert. Vielleicht bau ich das auch in eine UDF ein. Sollte ja nicht allzu schwierig sein. Mir ging es in erster Linie darum, eine Funktion zu schreiben, die mit relativ wenig Code für alle 4 Richtungen funktioniert.

  • Nette Idee, aber bei Multimonitoren funzt es nicht richtig!

    Gruß,
    UEZ

    Das ist schade. Ich kann mir schon denken warum:
    Es gibt doch einen Bug bezüglich @DesktopHeight bei Multi-Monitoren, oder?
    Ich meine mich an eine Funktion zu erinnern, die die Gesamtauflösung zurückgegeben hat. Finde sie aber nicht mehr :S

  • [autoit]


    #include <Array.au3>
    Global $hScreen = WinGetHandle("Program Manager")
    Global $aScreen_Res = WinGetPos($hScreen)
    #cs
    $array[0] = X position
    $array[1] = Y position
    $array[2] = Width
    $array[3] = Height
    #ce
    _ArrayDisplay($aScreen_Res)
    Exit

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Hallo UEZ,
    Funktioniert das jetzt besser auf deinem Dual-Monitor?

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <WindowsConstants.au3>
    HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
    $hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)

    [/autoit] [autoit][/autoit] [autoit]

    $h_Left = GUICreate("SlideGUI left", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    $_Button1 = GUICtrlCreateButton("Example Button", 40, 40, 100, 30)
    GUICtrlCreateEdit("Sample Edit...", 20, 90, 120, 200)
    $h_Right = GUICreate("SlideGUI Right", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateEdit("Sample Edit...", 20, 20, 150, 300)
    $h_Bottom = GUICreate("SlideGUI Bottom", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateCheckbox("Sample Checkbox", 40, 30)
    GUICtrlCreateCombo("Combo", 140, 50)
    $h_Top = GUICreate("SlideGUI Top", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    $_ListView = GUICtrlCreateListView("Columnd 1|Column 2", 5, 5, 340, 145)
    GUICtrlCreateListViewItem("Item 1_1|Item 1_2",$_ListView)
    GUICtrlCreateListViewItem("Item 2_1|Item 2_2",$_ListView)
    GUICtrlCreateListViewItem("Item 3_1|Item 3_2",$_ListView)

    [/autoit] [autoit][/autoit] [autoit]

    ; Move GUI's to the right place and set the Variables State to False
    Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
    _SlideWin($h_Left, "out", "left")
    _SlideWin($h_Right, "out", "right")
    _SlideWin($h_Bottom, "out", "bottom")
    _SlideWin($h_Top, "out", "top")

    [/autoit] [autoit][/autoit] [autoit]

    ; Show GUI's
    GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Top)

    [/autoit] [autoit][/autoit] [autoit]

    While 1 * Sleep(10)
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = -3
    Exit
    Case $nMsg[0] = $_Button1
    MsgBox(0, "", "Example Button clicked.")
    Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
    If Not $LEFT_IN Then ; If not already slide-in,
    _SlideWin($h_Left, "in", "left") ; Slide in GUI
    $LEFT_IN = True ; Set var to True.
    EndIf
    Case _WinIsHovered($h_Right, $hDLL)
    If Not $RIGHT_IN Then
    _SlideWin($h_Right, "in", "right")
    $RIGHT_IN = True
    EndIf
    Case _WinIsHovered($h_Bottom, $hDLL)
    If Not $BOTTOM_IN Then
    _SlideWin($h_Bottom, "in", "bottom")
    $BOTTOM_IN = True
    EndIf
    Case _WinIsHovered($h_Top, $hDLL)
    If Not $TOP_IN Then
    _SlideWin($h_Top, "in", "top")
    $TOP_IN = True
    EndIf
    Case Else ; No window is hovered. Check if we need to Slide out a GUI.
    Select
    Case $LEFT_IN
    _SlideWin($h_Left, "out", "left")
    $LEFT_IN = False
    Case $RIGHT_IN
    _SlideWin($h_Right, "out", "right")
    $RIGHT_IN = False
    Case $TOP_IN
    _SlideWin($h_Top, "out", "top")
    $TOP_IN = False
    Case $BOTTOM_IN
    _SlideWin($h_Bottom, "out", "bottom")
    $BOTTOM_IN = False
    EndSelect
    EndSelect
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _SlideWin($hWnd, $sMode, $sSide)
    ;$hWnd = Window to slide.
    ;$sMode = Slide-In or -out (in|out)
    ;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
    Local $aScreen_Res = WinGetPos(WinGetHandle("Program Manager"))
    Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
    Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")

    [/autoit] [autoit][/autoit] [autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit] [autoit][/autoit] [autoit]

    $aWPos = WinGetPos($hWnd)
    ; Slide GUI.
    Switch $sSide
    Case "left", "right"
    Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[0], $TO = $aWPos[0] _
    + (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
    - (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
    For $i = $aWPos[0] To $TO Step $STEP
    WinMove($hWnd, "", $i, $aWPos[1])
    Sleep(10)
    Next
    Case "top", "bottom"
    Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[1], $TO = $aWPos[1] _
    + (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
    - (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
    For $i = $aWPos[1] To $TO Step $STEP
    WinMove($hWnd, "", $aWPos[0], $i)
    Sleep(10)
    Next
    EndSwitch
    EndFunc ;==>_SlideWin

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinIsHovered($hWnd, $vDLL = "User32.dll")
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    $aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

    [/autoit] [autoit][/autoit] [autoit]

    Return $aResult[0] <> 0
    EndFunc ;==>_WinIsHovered

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($hDLL) ; Dont forget to close your DLL-Handle
    Exit
    EndFunc ;==>_Exit

    [/autoit]
    • Offizieller Beitrag

    Funktioniert bei mir mit Dual-Monitor einwandfrei.

  • Ist die selbe falsche Darstellung. Meine Laptop hat die Auflösung 1920x1200 und mein 2.ter Monitor 1280x1024 => 1920x2224! Laptop unten, Monitor oben!

    Display Array:
    [0]: 0
    [1]: -1024
    [2]: 1920
    [3]: 2224

    Gruß,
    UEZ

  • Mmmh.. Bei mir klappt nur das obere Fenster aus und ein. Alle anderen bewegen sich nicht.

    OS: Vista 64Bit SP2
    Auflösung: 1680x1050

    Zudem scheint sich das ausklappen des oberen Fensters nur auf die X-Achse zu berufen. Also selbst wenn ich über die Taskleiste fahre öffnet sich das Window. Ist das gewollt?

    MMM

  • Dieses Verhalten ist absolut unerwünscht. Ich kann mir nur vorstellen, dass es bei UEZ an der "negativen" auflösung liegt. Das Problem ist nur: Ein nachträgliches ändern der Slide Funktionen wird unglaubliche Kopfschmerzen bereiten (habt ihr euch die mal angeschaut ? :D)

    Momentan hat DescribeIt für mich allerdings höheren Stellenwert - vielleicht werd ich das hier in den nächsten Tagen / WOchen nochmal überarbeiten.

    LG

    //Edit:

    UEZ;

    [autoit]

    ; Ersetz mal bitte

    [/autoit][autoit][/autoit][autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit][autoit][/autoit][autoit]

    ;Durch:

    [/autoit][autoit][/autoit][autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    $aScreen_Res[0] - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    $aScreen_Res[1] - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit]
  • Hallo Leute habe gerade durch zufall den Thread durch google gefunden. Jetzt wollte ich das mit meiner Gui einbinden,

    aber leider kommt folgende Fehlermeldung:

    Code
    >"D:\Daten\Potable\SciTE4AutoIt3\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Daten\Potable\Autoit\scripte\Autologin\Autologin_slide.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams    
    +>10:29:29 Starting AutoIt3Wrapper v.2.0.3.0	Environment(Language:0407  Keyboard:00000407  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
    >Running AU3Check (1.54.19.0)  from:C:\Programme\AutoIt3
    +>10:29:29 AU3Check ended.rc:0
    >Running:(3.3.6.1):C:\Programme\AutoIt3\autoit3.exe "D:\Daten\Potable\Autoit\scripte\Autologin\Autologin_slide.au3"    
    D:\Daten\Potable\Autoit\scripte\Autologin\Autologin_slide.au3 (157) : ==> Subscript used with non-Array variable.:
    WinMove($hWnd, "", 0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) + (($h = 1) * (($h = 1) * @DesktopWidth - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) + (($h = 0) * (($h = 0) * (@DesktopWidth / 2) - ($aWPos[2] / 2))) , 0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) + (($v = 1) * (($v = 1) * @DesktopHeight - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) + (($v = 0) * (($v = 0) * (@DesktopHeight / 2) - ($aWPos[3] / 2))) )
    WinMove($hWnd, "", 0 - (($h = -1) * ($m = -1) * ($aWPos^ ERROR
    ->10:29:30 AutoIT3.exe ended.rc:1
    >Exit code: 1	Time: 1.810

    mit dem Beispiel funktioniert es. könnt ihr mir weiterhelfen?

    hier noch mein Code.

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ListViewConstants.au3>
    #Include <GuiListView.au3>

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
    $hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)

    [/autoit] [autoit][/autoit] [autoit]

    Global $h_Left,$h_Bottom,$h_Right,$h_Top

    [/autoit] [autoit][/autoit] [autoit]

    ;funktion für erstellen für die einzelnen Menüs

    [/autoit] [autoit][/autoit] [autoit]

    _menu_links()
    _menu_rechts()
    _menu_oben()
    ;_menu_unten()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; Move GUI's to the right place and set the Variables State to False
    Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
    _SlideWin($h_Left, "out", "left")
    _SlideWin($h_Right, "out", "right")
    _SlideWin($h_Bottom, "out", "bottom")
    _SlideWin($h_Top, "out", "top")

    [/autoit] [autoit][/autoit] [autoit]

    ; Show GUI's
    GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
    ;GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Top)

    [/autoit] [autoit][/autoit] [autoit]

    While 1 * Sleep(10)
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = -3
    Exit
    Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
    If Not $LEFT_IN Then ; If not already slide-in,
    _SlideWin($h_Left, "in", "left") ; Slide in GUI
    $LEFT_IN = True ; Set var to True.
    EndIf
    Case _WinIsHovered($h_Right, $hDLL)
    If Not $RIGHT_IN Then
    _SlideWin($h_Right, "in", "right")
    $RIGHT_IN = True
    EndIf
    Case _WinIsHovered($h_Bottom, $hDLL)
    If Not $BOTTOM_IN Then
    _SlideWin($h_Bottom, "in", "bottom")
    $BOTTOM_IN = True
    EndIf
    Case _WinIsHovered($h_Top, $hDLL)
    If Not $TOP_IN Then
    _SlideWin($h_Top, "in", "top")
    $TOP_IN = True
    EndIf
    Case Else ; No window is hovered. Check if we need to Slide out a GUI.
    Select
    Case $LEFT_IN
    _SlideWin($h_Left, "out", "left")
    $LEFT_IN = False
    Case $RIGHT_IN
    _SlideWin($h_Right, "out", "right")
    $RIGHT_IN = False
    Case $TOP_IN
    _SlideWin($h_Top, "out", "top")
    $TOP_IN = False
    Case $BOTTOM_IN
    _SlideWin($h_Bottom, "out", "bottom")
    $BOTTOM_IN = False
    EndSelect
    EndSelect
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _menu_links()
    $h_Left = GUICreate("Login", 307, 249, 320, 186)
    $mi_datei = GUICtrlCreateMenu("Datei")
    $mi_save = GUICtrlCreateMenuItem("Speichern", $mi_datei)
    $mi_einst = GUICtrlCreateMenuItem("Einstellungen", $mi_datei)
    $mi_exit = GUICtrlCreateMenuItem("Beenden", $mi_datei)
    $bt_myhr = GUICtrlCreateButton("MyHr / ESS", 48, 176, 65, 25)
    $bt_leman = GUICtrlCreateButton("Leman", 192, 176, 65, 25)
    $bt_mega = GUICtrlCreateButton("Megaplan", 48, 200, 65, 25)
    $bt_wmsti = GUICtrlCreateButton("WMSTI", 120, 176, 65, 25)
    $bt_orka = GUICtrlCreateButton("ORKA", 192, 200, 65, 25)
    $bt_sap = GUICtrlCreateButton("SAP", 120, 200, 65, 25)
    $h_Left = GUICtrlCreateListView("Programm|Usernmae|Passwort", 8, 8, 289, 161, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES))
    GUICtrlSetBkColor(-1, 0xFFFAFA)
    GUICtrlSetBkColor($h_Left,$GUI_BKCOLOR_LV_ALTERNATE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    func _menu_rechts()
    $h_Right = GUICreate("Login", 307, 249, 320, 186)
    $mi_datei = GUICtrlCreateMenu("Datei")
    $mi_save = GUICtrlCreateMenuItem("Speichern", $mi_datei)
    $mi_einst = GUICtrlCreateMenuItem("Einstellungen", $mi_datei)
    $mi_exit = GUICtrlCreateMenuItem("Beenden", $mi_datei)
    $bt_myhr = GUICtrlCreateButton("MyHr / ESS", 48, 176, 65, 25)
    $bt_leman = GUICtrlCreateButton("Leman", 192, 176, 65, 25)
    $bt_mega = GUICtrlCreateButton("Megaplan", 48, 200, 65, 25)
    $bt_wmsti = GUICtrlCreateButton("WMSTI", 120, 176, 65, 25)
    $bt_orka = GUICtrlCreateButton("ORKA", 192, 200, 65, 25)
    $bt_sap = GUICtrlCreateButton("SAP", 120, 200, 65, 25)
    $h_Right= GUICtrlCreateListView("Programm|Usernmae|Passwort", 8, 8, 289, 161, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES))
    GUICtrlSetBkColor(-1, 0xFFFAFA)
    GUICtrlSetBkColor($h_Right,$GUI_BKCOLOR_LV_ALTERNATE)
    endfunc

    [/autoit] [autoit][/autoit] [autoit]

    func _menu_oben()
    $h_Bottom = GUICreate("Login", 307, 249, 320, 186)
    $mi_datei = GUICtrlCreateMenu("Datei")
    $mi_save = GUICtrlCreateMenuItem("Speichern", $mi_datei)
    $mi_einst = GUICtrlCreateMenuItem("Einstellungen", $mi_datei)
    $mi_exit = GUICtrlCreateMenuItem("Beenden", $mi_datei)
    $bt_myhr = GUICtrlCreateButton("MyHr / ESS", 48, 176, 65, 25)
    $bt_leman = GUICtrlCreateButton("Leman", 192, 176, 65, 25)
    $bt_mega = GUICtrlCreateButton("Megaplan", 48, 200, 65, 25)
    $bt_wmsti = GUICtrlCreateButton("WMSTI", 120, 176, 65, 25)
    $bt_orka = GUICtrlCreateButton("ORKA", 192, 200, 65, 25)
    $bt_sap = GUICtrlCreateButton("SAP", 120, 200, 65, 25)
    $h_Bottom = GUICtrlCreateListView("Programm|Usernmae|Passwort", 8, 8, 289, 161, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES))
    GUICtrlSetBkColor(-1, 0xFFFAFA)
    GUICtrlSetBkColor($h_Bottom,$GUI_BKCOLOR_LV_ALTERNATE)
    endfunc

    [/autoit] [autoit][/autoit] [autoit]

    func _menu_unten()
    $h_Top = GUICreate("Login", 307, 249, 320, 186)
    $mi_datei = GUICtrlCreateMenu("Datei")
    $mi_save = GUICtrlCreateMenuItem("Speichern", $mi_datei)
    $mi_einst = GUICtrlCreateMenuItem("Einstellungen", $mi_datei)
    $mi_exit = GUICtrlCreateMenuItem("Beenden", $mi_datei)
    $bt_myhr = GUICtrlCreateButton("MyHr / ESS", 48, 176, 65, 25)
    $bt_leman = GUICtrlCreateButton("Leman", 192, 176, 65, 25)
    $bt_mega = GUICtrlCreateButton("Megaplan", 48, 200, 65, 25)
    $bt_wmsti = GUICtrlCreateButton("WMSTI", 120, 176, 65, 25)
    $bt_orka = GUICtrlCreateButton("ORKA", 192, 200, 65, 25)
    $bt_sap = GUICtrlCreateButton("SAP", 120, 200, 65, 25)
    $h_Bottom = GUICtrlCreateListView("Programm|Usernmae|Passwort", 8, 8, 289, 161, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES))
    GUICtrlSetBkColor(-1, 0xFFFAFA)
    GUICtrlSetBkColor($h_Bottom,$GUI_BKCOLOR_LV_ALTERNATE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _SlideWin($hWnd, $sMode, $sSide)
    ;$hWnd = Window to slide.
    ;$sMode = Slide-In or -out (in|out)
    ;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
    Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
    Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")

    [/autoit] [autoit][/autoit] [autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * @DesktopWidth - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * (@DesktopWidth / 2) - ($aWPos[2] / 2))) _
    , _
    0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * @DesktopHeight - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * (@DesktopHeight / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit] [autoit][/autoit] [autoit]

    $aWPos = WinGetPos($hWnd)
    ; Slide GUI.
    Switch $sSide
    Case "left", "right"
    Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[0], $TO = $aWPos[0] _
    + (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
    - (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
    For $i = $aWPos[0] To $TO Step $STEP
    WinMove($hWnd, "", $i, $aWPos[1])
    Sleep(10)
    Next
    Case "top", "bottom"
    Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[1], $TO = $aWPos[1] _
    + (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
    - (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
    For $i = $aWPos[1] To $TO Step $STEP
    WinMove($hWnd, "", $aWPos[0], $i)
    Sleep(10)
    Next
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_SlideWin

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinIsHovered($hWnd, $vDLL = "User32.dll")
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    $aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

    [/autoit] [autoit][/autoit] [autoit]

    Return $aResult[0] <> 0
    EndFunc ;==>_WinIsHovered

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($hDLL) ; Dont forget to close your DLL-Handle
    Exit
    EndFunc ;==>_Exit

    [/autoit]