#include <GUIConstantsEx.au3>
HotKeySet("{ESC}", "AutoMouseclick")
Local $hGUI = GUICreate("", 500, 500)
Local $x =GUICtrlCreateLabel("", 10, 30,500,50)
Local $y =GUICtrlCreateLabel("", 10, 100,500,50)
Local $idMyedit = GUICtrlCreateEdit("", 0,200,500, 97)
Local $aPos
GUICtrlSetFont($x,25)
GUICtrlSetFont($y,25)
GUISetState(@SW_SHOW, $hGUI)
While 1
$aPos = MouseGetPos()
GUICtrlSetData($x,$aPos[0])
GUICtrlSetData($y,$aPos[1])
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func AutoMouseclick()
Local $code ="MouseClick("&'"left"'&","&$aPos[0]&","&$aPos[1]&")"
GUICtrlSetData($idMyedit,$code)
EndFunc
|