biase,
You were overcomplicating things - and you misunderstood the slide in/out directions (they are not easy to interpret):
Try this:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global $sout = False
$Main = GUICreate("Slider", 500, (@DesktopHeight - _TaskBarHeight()), @DesktopWidth - 500, -1, BitOR($WS_SYSMENU, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$BgPic = GUICtrlCreatePic('background.jpg', 0, 0, 0, 0)
GUICtrlSetState($BgPic, $GUI_DISABLE)
While 1
$nMsg = GUIGetMsg()
$MPos = MouseGetPos()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $MPos[0] >= (@DesktopWidth - 1) And Not $sout
$sout = True
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Main, "int", 270, "long", 0x00040002) ; $AW_SLIDE_IN_RIGHT
Case $MPos[0] < (@DesktopWidth - 500) And $sout
$sout = False
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Main, "int", 270, "long", 0x00050001) ; $AW_SLIDE_OUT_RIGHT
EndSelect
WEnd
Func _TaskBarHeight()
Local $aPos = WinGetPos("[CLASS:Shell_TrayWnd; W:" & @DesktopWidth & "]")
Return $aPos[3]
EndFunc ;==>_TaskBarHeight
Any better?
M23