↧
#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #Region ### START Koda GUI section ### $Form1_1 = GUICreate("Form1_1", 170, 135, 222, 464) $Save = GUICtrlCreateMenu("Save") $hX = GUICtrlCreateInput("pos[0]", 16, 16, 49, 21) $hY = GUICtrlCreateInput("pos[1]", 104, 16, 49, 21) $MouseCoordX = GUICtrlCreateInput("-1", 16, 96, 49, 21) $MouseCoordY = GUICtrlCreateInput("-1", 104, 96, 49, 21) $N = GUICtrlCreateInput("1", 64, 56, 33, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;pre-declare x & y local $X[5] local $Y[5] ;pre-declare end HotKeySet("{SPACE}", "Var") While 1 $nSet = GUICtrlRead($N) $pos = MouseGetPos() GUICtrlSetData($hX, $pos[0]) GUICtrlSetData($hY, $pos[1]) If $nSet > 0 then GUICtrlSetData($MouseCoordX, $x[$nSet]) GUICtrlSetData($MouseCoordY, $y[$nSet]) EndIf $Msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() fileDelete(@tempDir & "\image9.jpg") ExitLoop Exit Case $msg = $Save IniWrite("Vars.ini", "Variables", "X", $X[5]) EndSelect WEnd Func Var() If $nSet > 0 then $x[$nSet] = $pos[0] $y[$nSet] = $pos[1] GUICtrlSetData($N, $nSet + 1) EndIf EndFunc