retaly, Use a flag to indicate if the mouse position should be displayed - like this: #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Coord", 189, 79, 297, 228)
$x = GUICtrlCreateEdit("", 24, 16, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)
GUICtrlSetData(-1, "0")
$y = GUICtrlCreateEdit("", 120, 16, 57, 17, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NUMBER, $WS_BORDER), 0)
GUICtrlSetData(-1, "0")
$Button1 = GUICtrlCreateButton("Ok", 56, 40, 75, 25)
$Label1 = GUICtrlCreateLabel("x", 8, 16, 17, 17, BitOR($SS_CENTER, $WS_BORDER))
GUICtrlSetBkColor(-1, 0xFFFBF0)
$Label2 = GUICtrlCreateLabel("y", 104, 16, 17, 17, BitOR($SS_CENTER, $WS_BORDER))
GUICtrlSetBkColor(-1, 0xFFFBF0)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
HotKeySet("q", "_End")
$fRun = False
While 1
If $fRun Then
$aPos = MouseGetPos ()
GUICtrlSetData($x, $aPos[0])
GUICtrlSetData($y, $aPos[1])
EndIf
Switch GUIGetMsg()
Case $Button1
$fRun = True
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _End()
$fRun = False
EndFuncNote I used the "Q" key to stop - you cannot use F12 as a HotKey. M23