How would i go about saving a mouse position into a variable, atm i have this but im really not sure if its the proper way to do it Im still very new to this Global $xyLocation = MouseGetPos()
$Start_Exit_GUI = GUICreate("EXAMPLE", 228, 194, 398, 222)
GUISetBkColor(0x0000FF)
$Loc_Button = GUICtrlCreateButton("GET LOCATION", 0, 0, 227, 89, $WS_GROUP)
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
$Exit_Button = GUICtrlCreateButton("EXIT", 0, 96, 227, 97, $WS_GROUP)
GUICtrlSetFont(-1, 28, 400, 0, "Absolute Zero")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Loc_Botton
LocButton()
Case $Exit_Button
Terminate()
EndSwitch
WEnd
Func LocButton()
MsgBox(0, "NOTICE", "Click on the Location you want")
MouseClick($xyLocation[0],$xyLocation[1]
MsgBox(0, "LOCATION","Location has been set")
EndFunc
Func Terminate()
Exit 1
EndFunc
I want $xyLocation to hold whatever x-y Coordinates from where the user clicks AFTER the MsgBox() is gone Thanks in advance for any help