#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 50, 193, 125, $WS_POPUP)
$Input1 = GUICtrlCreateInput("这里输入数字", 24, 16, 201, 21)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYDOWN
mouseCHK()
EndSwitch
WEnd
Func mouseCHK()
$MS = GUIGetCursorInfo($Form1)
If $MS[4] = $Input1 Then move()
EndFunc ;==>mouseCHK
Func move()
Local $PosDiff[2], $MousePos, $WinPos
$MousePos = MouseGetPos()
$WinPos = WinGetPos($Form1, "")
$PosDiff[0] = $WinPos[0] - $MousePos[0]
$PosDiff[1] = $WinPos[1] - $MousePos[1]
While _IsPressed("01", DllOpen("user32.dll"))
$MousePos = MouseGetPos()
WinMove($Form1, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
Sleep(10)
WEnd
EndFunc ;==>move
|