[C++] 纯文本查看 复制代码
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
HotKeySet("{LEFT}", "_left")
HotKeySet("{UP}", "_up")
HotKeySet("{RIGHT}", "_right")
HotKeySet("{DOWN}", "_down")
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("鼠标控制器", 419, 133, 192, 124)
$Label1 = GUICtrlCreateLabel("△X", 40, 40, 36, 17)
$Input1 = GUICtrlCreateInput("20", 88, 40, 65, 21)
$Label2 = GUICtrlCreateLabel("△Y", 40, 80, 36, 17)
$Input2 = GUICtrlCreateInput("20", 88, 72, 65, 21)
$Button1 = GUICtrlCreateButton("开始", 240, 48, 81, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $hDLL = DllOpen("user32.dll")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
change()
EndSwitch
WEnd
Func change()
$btn = ControlGetText("鼠标控制器", "", $Button1)
If $btn = "开始" Then
ControlSetText("鼠标控制器", "", $Button1, "暂停")
Else
ControlSetText("鼠标控制器", "", $Button1, "开始")
EndIf
EndFunc ;==>change
Func _left()
$btn = ControlGetText("鼠标控制器", "", $Button1)
If $btn <> "开始" Then
$dx = ControlGetText("鼠标控制器", "", $Input1)
$dy = ControlGetText("鼠标控制器", "", $Input2)
Local $aPos = MouseGetPos()
MouseMove($aPos[0] - $dx, $aPos[1], 0)
Sleep(100)
EndIf
EndFunc ;==>_left
Func _up()
$btn = ControlGetText("鼠标控制器", "", $Button1)
If $btn <> "开始" Then
$dx = ControlGetText("鼠标控制器", "", $Input1)
$dy = ControlGetText("鼠标控制器", "", $Input2)
Local $aPos = MouseGetPos()
MouseMove($aPos[0], $aPos[1] - $dy, 0)
EndIf
EndFunc ;==>_up
Func _right()
$btn = ControlGetText("鼠标控制器", "", $Button1)
If $btn <> "开始" Then
$dx = ControlGetText("鼠标控制器", "", $Input1)
$dy = ControlGetText("鼠标控制器", "", $Input2)
Local $aPos = MouseGetPos()
MouseMove($aPos[0] + $dx, $aPos[1], 0)
EndIf
EndFunc ;==>_right
Func _down()
$btn = ControlGetText("鼠标控制器", "", $Button1)
If $btn <> "开始" Then
$dx = ControlGetText("鼠标控制器", "", $Input1)
$dy = ControlGetText("鼠标控制器", "", $Input2)
Local $aPos = MouseGetPos()
MouseMove($aPos[0], $aPos[1] + $dy, 0)
EndIf
EndFunc ;==>_down