#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=little iconpack\icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include<WindowsConstants.au3>
#include<Misc.au3>
$hGui = GUICreate("", 400, 400, default, default, $WS_POPUP)
$bhandle = GUICtrlCreateButton("Button :>", 30, 30, 60, 55)
GUISetBkColor(0x00FF00)
GUISetState()
while 1
$mPos = GUIGetCursorInfo()
if IsArray($mPos) And _IsPressed(01) Then
$Fenster_Position = WinGetPos($hGui) ; Fensterposition herrausfinden
$Maus_Position = MouseGetPos() ; Mausposition herrausfinden
$Maus_Position_Vorher = MouseGetPos() ; "
While _IsPressed(01) = 1
$Maus_Position = MouseGetPos() ; Die neue Mausposition herausfinden
WinMove($hGui, "", $Maus_Position[0] - $Maus_Position_Vorher[0] + $Fenster_Position[0], $Maus_Position[1] - $Maus_Position_Vorher[1] + $Fenster_Position[1])
; Keine ahnung warum, aber es geht^^
WEnd
EndIf
if _IsPressed("1B") Then exit ; ESC
WEnd
While 2
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $bhandle
_llo()
EndSwitch
WEnd
func _llo()
msgbox(0, "", "")
EndFunc
Warum Funktioniert das mit dem button nicht?